Bird
0
0

Why does bundle exec sometimes run slower than running a Ruby command directly?

hard📝 Conceptual Q10 of 15
Ruby - Gems and Bundler

Why does bundle exec sometimes run slower than running a Ruby command directly?

ABecause it sets up a separate gem environment and loads Bundler first
BBecause it downloads gems every time it runs
CBecause it compiles Ruby code before execution
DBecause it runs commands in a virtual machine
Step-by-Step Solution
Solution:
  1. Step 1: Understand what bundle exec does internally

    It loads Bundler and sets up the gem environment before running the command.

  2. Step 2: Explain why this causes delay

    This setup adds overhead, making execution slower than running Ruby directly.

  3. Final Answer:

    Because it sets up a separate gem environment and loads Bundler first -> Option A
  4. Quick Check:

    bundle exec overhead causes slower startup [OK]

Quick Trick: bundle exec loads Bundler, adding startup overhead [OK]
Common Mistakes:
  • Thinking it downloads gems every run
  • Assuming it compiles Ruby code
  • Believing it uses a virtual machine

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes