[ SDF Public Access UNIX System .. Est. 1987 ]

join welcome faq status members projects store tour gopher abuse dialup
nihongo chinese europa usermap webmail forum gallery elearn irc tutorials software telnet ssh

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 here.

RubyGems is a package manager for the 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:

  1. Make a directory for gem installation:
    $ mkdir ~/.gems
    
  2. Set up your .gemrc:
    $ cat << 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
    EOF
    
  3. Set up some environment variables for run-time:
    $ cat << EOF >> ~/.profile
    export GEM_HOME=$HOME/.gems
    export GEM_PATH=$HOME/.gems:/usr/pkg/lib/ruby/gems/1.8
    export PATH=$PATH:$HOME/.gems/bin
    EOF
    
  4. 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 online documentation are your friends.
$Id: rubygems.html,v 1.7 2010/07/24 10:07:59 nerfling Exp $

©1987-2010 SDF Public Access UNIX System, Inc. 501(c)(7)
(this page was generated using ksh, sed and awk)