This shows you the differences between two versions of the page.

Link to this comparison view

tutorials:rubygems [2011/04/30 14:44] (current)
clemens created
Line 1: Line 1:
 +====== Using RubyGems at SDF ======
 +//NOTE: Consider requesting system-wide installation of gems that others may find useful, instead of installing local copies for yourself. The usual way of making such requests is to post on the REQUESTS bboard. For a brief introduction to bboard, go [[http://​sdf.org/​tutorials/​unx/​node7.html#​SECTION00730000000000000000|here]].//​
 +[[http://​rubygems.org/​|RubyGems]] is a [[http://​en.wikipedia.org/​wiki/​Package_manager|package manager]] for the [[http://​www.ruby-lang.org/​|Ruby programming language]].
 +Since you're most likely a non-privileged SDF user, you cannot install //gems// the traditional way. This is due to the fact that "gem install GEMNAME"​ tries to bulk update its cache of available gems at gems.rubyforge.org which will exceed your RAM quota. You should thus setup the '​gem'​ command to install gems locally:
 +  * Make a directory for gem installation:​
 +    * $ mkdir ~/.gems
 +  * Set up your .gemrc:
 +    * $ cat &​lt;&​lt;​ EOF > ~/.gemrc
 +    * gem: --no-ri --no-rdoc --local # Local install, but don't generate documentation
 +    * gemhome: $HOME/.gems
 +    * gempath:
 +      * $HOME/.gems
 +      * /​usr/​pkg/​lib/​ruby/​gems/​1.8
 +  * Set up some environment variables for run-time:
 +    * $ cat &​lt;&​lt;​ EOF &​gt;&​gt;​ ~/.profile
 +    * export GEM_HOME=$HOME/​.gems
 +    * export GEM_PATH=$HOME/​.gems:/​usr/​pkg/​lib/​ruby/​gems/​1.8
 +    * export PATH=$PATH:​$HOME/​.gems/​bin
 +At this point, you can start downloading gems and then install them. Note that you have to resolve their dependencies yourself. If you need help, "gem help install"​ and the [[http://​rubygems.org|online documentation]] are your friends.