0
0
Rubyprogramming~20 mins

Gem installation with gem install in Ruby - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Gem Installation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2: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
Acolorize (1.0.0)
Bcolorize (not installed)
Ccolorize (0.8.1)
DNo output related to colorize
Attempts:
2 left
💡 Hint
The gem list shows installed gems with their versions.
🧠 Conceptual
intermediate
1:30remaining
Understanding gem install options
Which gem install option installs a gem only for the current user, not system-wide?
A--local
B--system
C--global
D--user-install
Attempts:
2 left
💡 Hint
Think about installing gems without needing admin rights.
🔧 Debug
advanced
2: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?
AThe gem name is misspelled
BYou need to run the command with sudo or use --user-install
CRuby is not installed
DThe internet connection is down
Attempts:
2 left
💡 Hint
Permission errors usually mean you lack rights to write to system folders.
📝 Syntax
advanced
1:30remaining
Correct syntax to install a specific gem version
Which command correctly installs version 2.7.0 of the gem 'nokogiri'?
Agem install nokogiri -v 2.7.0
Bgem install nokogiri --version=2.7.0
Cgem install nokogiri --v 2.7.0
Dgem install nokogiri version 2.7.0
Attempts:
2 left
💡 Hint
The short option for version is '-v'.
🚀 Application
expert
2: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?
Agem install rails -v 7.0.0 puma -v 5.0.4
Bgem install rails:7.0.0 puma:5.0.4
Cgem install rails --version 7.0.0 && gem install puma --version 5.0.4
Dgem install rails -v7.0.0,puma -v5.0.4
Attempts:
2 left
💡 Hint
You can list multiple gems with their versions separated by spaces.