Ruby gem – handy reference

Ruby gem is a package manager for the Ruby programming language. Here are some gem handy commands on Mac or Linux.

  1. Install a package
    $ sudo gem install rails
    
  2. Uninstall a package
    $ sudo gem uninstall rails
    
  3. List installed packages
    $ gem list
    
  4. Show contents of an installed package
    $ gem contents rails
    
  5. List commands and get help for a command
    $ gem help commands
    $ gem help list
    
  6. Search remote gems by regex
    $ gem search sass
    
  7. Find the location of a library file you can require
    $ gem which sass
    
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments