How to Install Gems From Command Line in Ruby

Gems are a type of plug-in for the Ruby programming language. Gems can help you integrate with a third-party service via its API, or Application Programming Interface, which lets you interact with data on systems such as Twitter and Facebook. It can provide out-of-the-box functionality for a number of features and can provide additional extensions to the base Ruby language. You can install a new gem straight from the command line on any system that has Ruby installed. The gem installation command first looks for gem files stored locally on your machine. If it cannot find such a gem, it pulls from the Internet gem repository automatically.

Instructions

    • 1

      Click "Start" and type "cmd" without the quotation marks to launch the command line application in Windows. Click the "Terminal" application to open the command line on a Mac.

    • 2

      Type "cd directory"--replacing "directory" with the directory you want to switch to if the gem file you want to install is located on your computer.

    • 3

      Type the the following command: "gem install gemname" and replace "gemname" with the exact name of the gem you want to install.

    • 4

      Press "Enter." The installer locates the gem on your computer or, if it is not on your computer, looks for and downloads a gem with that name from the Internet gem repository. The gem is now installed on your machine.

Tips & Warnings

  • Find the exact name of the gem you want to install by consulting that gem's page on RubyGems.org.

  • If you're working with Ruby on Rails, use Bundler to install gems.

  • Make sure you type the name of the gem correctly. If you mistype the gem name, the installer will not be able to locate it to install it.

Related Searches:

References

Resources

Comments

You May Also Like

  • How Are Gems Different From Regular Minerals?

    A gem is a special type of mineral. Minerals are naturally occurring substances in the earth, and come in many forms. While...

  • How to Install Rake Gems

    Rake is a build application for the Ruby Programming Language designed to allow developers to create Unix-style Makefiles for their Ruby applications....

  • How to Install Ruby Gems in Linux

    RubyGems is a software package manager for use with the Ruby programming language. It gives users a standardized method of sharing libraries...

  • How to Manually Install a Ruby Gem

    Gem is a package manager designed to make it easy to find, download, and install libraries for use by the Ruby programming...

  • How to Install RAM

    If your computer slows down when you're working with large files or many programs at once, you might be able to improve...

Related Ads

Featured