RubyGems
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.
-
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. -
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
-
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.
-
Install Ruby:
prompt$ sudo yum install ruby
-
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>.
-
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.
-
Install Ruby:
prompt$ yast -i ruby
-
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.
-
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
-
Run the
bash
script to installrvm
from <a href="https://rvm.beginrescueend.com/install/rvm">Ruby Version Manager</a>.prompt$ bash << curl -s https://rvm.beginrescueend.com/install/rvm
-
Edit your ~/.bashrc file as described by the RVM installation in the precding step.
-
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>