Bird
0
0

Which command correctly runs the Ruby script my_script.rb using bundle exec?

easy📝 Syntax Q3 of 15
Ruby - Gems and Bundler

Which command correctly runs the Ruby script my_script.rb using bundle exec?

Abundle exec ruby my_script.rb
Bruby bundle exec my_script.rb
Cbundle exec my_script.rb ruby
Druby my_script.rb bundle exec
Step-by-Step Solution
Solution:
  1. Step 1: Understand Command Structure

    The correct syntax is bundle exec followed by the command to run, then its arguments.
  2. Step 2: Apply to Ruby Script

    To run a Ruby script, the command is ruby my_script.rb. Prepending bundle exec isolates gem versions.
  3. Final Answer:

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

    Is bundle exec placed before the command? Yes. [OK]
Quick Trick: Place bundle exec before the command [OK]
Common Mistakes:
  • Placing bundle exec after the command
  • Mixing order of arguments
  • Using incorrect command syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes