Bird
0
0

After adding a new gem to your Gemfile, you run bundle install but the gem is not available in your project. What is the likely mistake?

medium📝 Debug Q7 of 15
Ruby - Gems and Bundler
After adding a new gem to your Gemfile, you run bundle install but the gem is not available in your project. What is the likely mistake?
ANot running <code>bundle install</code> after editing Gemfile
BRunning <code>bundle install</code> without saving Gemfile changes
CRunning <code>bundle update</code> instead of <code>bundle install</code>
DNot requiring the gem in your Ruby code
Step-by-Step Solution
Solution:
  1. Step 1: Check if Gemfile changes were saved before running bundle install

    If Gemfile was not saved, bundle install uses old file without new gem.
  2. Step 2: Understand that bundle install reads current Gemfile

    Unsaved changes mean new gem is not recognized or installed.
  3. Final Answer:

    Running bundle install without saving Gemfile changes -> Option B
  4. Quick Check:

    Save Gemfile before bundle install to add gems [OK]
Quick Trick: Always save Gemfile before running bundle install [OK]
Common Mistakes:
  • Forgetting to save Gemfile after edits
  • Confusing bundle install and bundle update effects
  • Not requiring gem in code but blaming Bundler

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes