Recall & Review
beginner
What is a Ruby gem?
A Ruby gem is a packaged library or tool that you can add to your Ruby programs to use extra features without writing them yourself.
Click to reveal answer
beginner
What command do you use to install a gem?
You use
gem install gem_name to download and install a gem on your system.Click to reveal answer
intermediate
How do you install a specific version of a gem?
Use
gem install gem_name -v 'version_number' to install that exact version.Click to reveal answer
beginner
What does the
gem list command do?It shows all the gems currently installed on your system.
Click to reveal answer
intermediate
Why might you need to use
sudo with gem install?Because installing gems system-wide may require administrator rights, so
sudo gives permission to install.Click to reveal answer
Which command installs the 'rails' gem?
✗ Incorrect
The correct syntax is
gem install rails to install the 'rails' gem.How do you check which gems are installed on your system?
✗ Incorrect
gem list shows all installed gems.What option installs version 2.1.0 of a gem named 'nokogiri'?
✗ Incorrect
Use
-v 'version_number' to specify the version.Why might you need to run
sudo gem install?✗ Incorrect
sudo gives permission to install gems system-wide.What happens if you run
gem install without a gem name?✗ Incorrect
You must specify a gem name to install; otherwise, it shows an error.
Explain how to install a Ruby gem and check if it is installed.
Think about the commands you type in the terminal to add and see gems.
You got /3 concepts.
Describe why you might need to use
sudo when installing gems and how to install a specific version.Consider system permissions and gem version control.
You got /3 concepts.