Bird
0
0

What will be the output of the following commands?

medium📝 Predict Output Q4 of 15
Ruby - Ecosystem and Best Practices
What will be the output of the following commands?
rbenv install 3.1.0
rbenv local 3.1.0
ruby -v
Aruby 3.1.0 (installed)
Bruby 3.1.0 (local)
Cruby 3.1.0 (set by rbenv)
Druby 3.1.0 (default)
Step-by-Step Solution
Solution:
  1. Step 1: Understand the effect of rbenv install and rbenv local

    The first command installs Ruby 3.1.0, the second sets it locally for the directory.
  2. Step 2: Check what ruby -v shows

    It shows the Ruby version currently active, which rbenv sets as 3.1.0 with a note indicating rbenv manages it.
  3. Final Answer:

    ruby 3.1.0 (set by rbenv) -> Option C
  4. Quick Check:

    Ruby version output shows rbenv set version [OK]
Quick Trick: After setting local version, ruby -v shows rbenv version [OK]
Common Mistakes:
  • Expecting output to say (default) or (installed)
  • Ignoring that rbenv manages the version shown
  • Confusing local and global version outputs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes