Challenge - 5 Problems
Gem Installation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of gem list after installing a gem
You run
gem install colorize and then gem list. What will be part of the output?Ruby
gem install colorize gem list
Attempts:
2 left
💡 Hint
The gem list shows installed gems with their versions.
✗ Incorrect
After installing the gem 'colorize', running 'gem list' will show it with its installed version, for example 'colorize (0.8.1)'.
🧠 Conceptual
intermediate1:30remaining
Understanding gem install options
Which
gem install option installs a gem only for the current user, not system-wide?Attempts:
2 left
💡 Hint
Think about installing gems without needing admin rights.
✗ Incorrect
The
--user-install option installs the gem in the user's home directory, avoiding system-wide changes.🔧 Debug
advanced2:00remaining
Why does gem install fail with permission denied?
You run
gem install rails and get a permission denied error. What is the most likely cause?Attempts:
2 left
💡 Hint
Permission errors usually mean you lack rights to write to system folders.
✗ Incorrect
Installing gems system-wide requires admin rights. Without them, permission denied errors occur.
📝 Syntax
advanced1:30remaining
Correct syntax to install a specific gem version
Which command correctly installs version 2.7.0 of the gem 'nokogiri'?
Attempts:
2 left
💡 Hint
The short option for version is '-v'.
✗ Incorrect
The correct syntax uses '-v' followed by the version number without '='.
🚀 Application
expert2:30remaining
How to install multiple gems in one command
You want to install 'rails' version 7.0.0 and 'puma' version 5.0.4 in one command. Which is correct?
Attempts:
2 left
💡 Hint
You can list multiple gems with their versions separated by spaces.
✗ Incorrect
The correct syntax is to list each gem with its '-v' option separated by spaces in one command.