Bird
0
0

What will happen if you add this line to your Gemfile?

medium📝 Predict Output Q5 of 15
Ruby - Gems and Bundler
What will happen if you add this line to your Gemfile?
gem 'nokogiri', '~> 1.12.0', require: false
ANokogiri gem is installed and always loaded automatically
BNokogiri gem is not installed at all
CNokogiri gem is installed but not automatically loaded
DThis line causes a syntax error
Step-by-Step Solution
Solution:
  1. Step 1: Understand the meaning of require: false

    This option tells Bundler to install the gem but not load it automatically in the program.
  2. Step 2: Check the effect on gem installation and loading

    The gem is installed but you must manually require it in your code.
  3. Final Answer:

    Nokogiri gem is installed but not automatically loaded -> Option C
  4. Quick Check:

    require: false = install but don't auto-load [OK]
Quick Trick: require: false means manual loading needed [OK]
Common Mistakes:
  • Thinking require: false skips installation
  • Assuming gem loads automatically despite require: false
  • Confusing syntax causing errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes