Jump to: navigation, search

RubyGems

Revision as of 08:48, 24 April 2012 by Bholtsclaw (talk) (Initial revision on how to install Ruby and RubyGems for requirements to other OpenStack software or apis)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The following sections provide basic information about installing Ruby and RubyGems on Windows as well as Linux computers from a few vendors and 'How to Access and Update' Ruby and RubyGems on OS X 10.5+.

Windows

Download and install <a href="http://www.rubyinstaller.org/" title="ruby installer for windows">Ruby Installer for Windows</a>. The installer already includes RubyGems.

Be sure you use the Ruby-enabled command prompt window when you later install and use vmc. You access this command prompt from the Windows Start menu (All Programs > Ruby <version> > Start Command Prompt with Ruby).

Finally, update RubyGems from the Ruby Command Prompt:

<code>prompt> gem update --system
</code>

Mac OS X

Version 10.5 and higher of Mac OS X already ships with Ruby and RubyGems installed.

If you are using an earlier version of Mac OS, try following any directions at <a href="http://rubygems.org/pages/download">RubyGems</a> to see if your version is still supported unofficially.

Ubuntu

Open up the 'Software Center' app from your launcher and type in `RubyGems` without quotes into the application search box at the top right, and press [enter]. RubyGems then can be installed by just clicking on the button labeled 'Install', thats it. Follow any extra instructions from the Software Center should there be any during or after installation.

Alternatively you can install from a terminal as well, use the apt-get command-line tool to install Ruby and RubyGems, as shown below.

  1. Install the full Ruby package and RubyGems:

    prompt$ sudo apt-get install ruby-full rubygems

    Consult your system administrator for any required authentication credentials for the sudo command.

  2. Test to ensure that the gem command is in your path:

    prompt$ which gem

    If the command is not found, then update your PATH variable accordingly. For example, you can update your .bashrc file with the following line:

    export PATH=$PATH:/var/lib/gems/1.8/bin

  3. Update RubyGems:

    Ubuntu 10.04

    <code>prompt$ sudo gem install rubygems-update
    prompt$ sudo /var/lib/gems/1.8/bin/update_rubygems
    </code>

    Ubuntu 11.10

    <code>prompt$ sudo su -
    prompt# export REALLY_GEM_UPDATE_SYSTEM=true
    prompt# gem update --system
    prompt# exit
    </code>

RedHat

From a terminal, use the yum command-line tool to install Ruby and RubyGems, as shown below.

  1. Install Ruby:

    prompt$ sudo yum install ruby

  2. If you are using RedHat Enterprise Linux 6, enable the Optional channel for your host by logging into <a href="https://rhn.redhat.com/">Red Hat Network (RHN)</a>.

  3. Install RubyGems:

    prompt$ sudo yum install rubygems

SuSE

From a terminal, use the yast command-line tool to install Ruby and RubyGems, as shown below.

  1. Install Ruby:

    prompt$ yast -i ruby

  2. Install RubyGems:

    prompt$ yast -i rubygems

Debian

You use Ruby Version Manager (rvm) to install Ruby and RubyGems on Debian. The following procedure shows how to install rvm if you have not already done so.

  1. Use the following apt-get command-line tool to install the required packages:

    prompt$ sudo apt-get install gcccurl git-core build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev

  2. Run the bash script to install rvm from <a href="https://rvm.beginrescueend.com/install/rvm">Ruby Version Manager</a>.

    prompt$ bash << curl -s https://rvm.beginrescueend.com/install/rvm

  3. Edit your ~/.bashrc file as described by the RVM installation in the precding step.

  4. Use rvm to install Ruby and RubyGems as shown:

    prompt$ rvm package install zlib

    prompt$ rvm install 1.9.2 -C --with-zlib-dir=$rvm_path/usr

    prompt$ rvm use 1.9.2

</div> </div> </div> </div> </div> </div> </div>