Bird
0
0

Which of the following is the correct syntax to run a Ruby script app.rb using bundle exec?

easy📝 Syntax Q12 of 15
Ruby - Gems and Bundler

Which of the following is the correct syntax to run a Ruby script app.rb using bundle exec?

Abundle exec ruby app.rb
Bruby bundle exec app.rb
Cbundle ruby exec app.rb
Dexec bundle ruby app.rb
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct command order

    The correct syntax places bundle exec before the command to run, here ruby app.rb.
  2. Step 2: Validate options

    Only bundle exec ruby app.rb correctly places bundle exec before ruby app.rb. Others mix order incorrectly.
  3. Final Answer:

    bundle exec ruby app.rb -> Option A
  4. Quick Check:

    bundle exec before command = C [OK]
Quick Trick: Put 'bundle exec' right before the command you want to run [OK]
Common Mistakes:
  • Swapping order of bundle exec and ruby
  • Inserting exec or bundle in wrong places
  • Omitting bundle exec entirely

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes