Transferred from: http://www.jianshu.com/p/728184da1699
Gem Introduction:
Gem is a standard package for managing Ruby libraries and programs, and it is easy to find, install, upgrade, and uninstall packages through Ruby Gems such as http://rubygems.org/.
Ruby 1.9. Version 2 has the Ruby Gem installed by default, and if you are using a different distribution, see "How to Install Ruby Gem".
How to install the Ruby gem package:
All gem packages will be installed into the/[ruby root]/lib/ruby/gems/[ver]/directory, which includes the cache, doc, gems, specifications 4 directories, the cache is placed under the download of the native gem package, The gems is placed under the extracted gem package.
When problems are encountered during installation, you can go to these directories, manually delete the problematic gem package, and then rerun the gem install [gemname] command.
The Ruby Gem command is detailed:
Update Gem itself
Note: This command disables execution for system stability in some Linux distributions
$ gem Update--system
Install the gem package from the Gem source
$ gem install [Gemname]
Install the gem package from native
$ Gem install-l [Gemname].gem
Install the specified version of the gem package
$ gem install [gemname]--version=[ver]
Update all installed gem packs
$ gem Update
Update the specified GEM package
Note: Gem Update [gemname] does not upgrade an older version of the package, you can use the gem install [gemname]--version=[ver] instead
$ gem Update [Gemname]
Delete the specified gem package, note that this command will remove all installed versions
$ gem Uninstall [Gemname]
Delete a specified version of the gem
$ gem Uninstall [Gemname]--version=[ver]
View all the gem packages that are installed on this computer
$ gem list [--local]
Wen/mklaus (author of Jane's book)
Original link: http://www.jianshu.com/p/728184da1699
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".
The Ruby Gem command is detailed