Bird
0
0

Why is it important to specify gem versions in your Gemfile rather than always using the latest version?

hard📝 Conceptual Q10 of 15
Ruby - Gems and Bundler
Why is it important to specify gem versions in your Gemfile rather than always using the latest version?
ATo reduce the size of the gem files
BTo avoid unexpected bugs from incompatible gem updates
CTo make gem installation faster
DTo allow gems to update automatically without control
Step-by-Step Solution
Solution:
  1. Step 1: Understand gem version specification

    Specifying versions prevents automatic updates that might introduce breaking changes or bugs.
  2. Step 2: Recognize risks of always using latest gems

    Using latest versions without control can cause unexpected errors in your project.
  3. Final Answer:

    To avoid unexpected bugs from incompatible gem updates -> Option B
  4. Quick Check:

    Version pinning prevents bugs from updates [OK]
Quick Trick: Pin gem versions to prevent breaking changes [OK]
Common Mistakes:
  • Thinking version pinning speeds up installs
  • Believing it reduces gem file size
  • Assuming automatic updates are always good

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes