User Tools

Site Tools


ruby:rubyinstall

Installing Ruby

Compile Ruby on CentOS 6

the following dependencies are required to compile Ruby on CentOS 6:

yum install gcc make libyaml-devel readline-devel openssl-devel zlib-devel

“configure & make & make install”

RVM

http://rvm.beginrescueend.com

Get the latest rvm version

rvm get latest

With rvm you can have several versions of Ruby installed in parallel.

For Ruby 1.9 use

rvm install 1.9.2

For Ruby 1.8 use

rvm install 1.8.7

For Ruby Enterprise Edition use:

rvm install ree

You can then switch between them, e.g. with

rvm ruby-1.9.2

Or you can set one as the default, e.g. with

rvm ruby-1.9.2 --default

Each Ruby maintains its own set of gems. Rails 3 works with any of the above mentioned Ruby versions and Rails 2 works at least with Ruby 1.8 and Ruby Enterprise Edition. To update Ruby just issue the corresponding install command again. To update all gems use:

gem update --system

Create a new gemset and make it default

rvm ruby-1.9.2-p180@rails31 --create --default

Gem

Disabling Documentation Builds (optional)

By default Ruby gems will be installed with their fully formatted rdoc and ri documentation. If you are permanently connected to the internet anyway this is probably a waste of disk space. On the other hand it is convenient to have the documentation for the exact set of gems that you use. Likewise on a Laptop you may want to have the documentation available even if offline or you might feel space constraints on a crowded disk. Consider the pros and cons and if you decide that you don't want the docs in your home directory, add the following line to your $HOME/.gemrc file:

gem: --no-rdoc --no-ri
/srv/wiki.niwos.com/data/pages/ruby/rubyinstall.txt · Last modified: 2012/10/27 11:37 by niwo