0
0
Rubyprogramming~5 mins

Gem installation with gem install in Ruby - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Agem install rails
Binstall gem rails
Crails gem install
Dgem rails install
How do you check which gems are installed on your system?
Agem show
Bgem check
Cgem list
Dgem status
What option installs version 2.1.0 of a gem named 'nokogiri'?
Agem install nokogiri --version 2.1.0
Bgem install nokogiri -v '2.1.0'
Cgem install nokogiri version 2.1.0
Dgem install nokogiri v2.1.0
Why might you need to run sudo gem install?
ATo get administrator permission for system-wide gem installation
BTo speed up the installation
CTo uninstall gems
DTo update Ruby itself
What happens if you run gem install without a gem name?
AIt updates Ruby
BIt installs all available gems
CIt lists installed gems
DIt shows an error asking for a gem name
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.