Installing Ruby 1.9.1 on Linux by Source Code

Actually, the following steps will work with any recent version of Ruby, probably.

The following instructions assume you’ll be install Ruby under /opt/local/ruby/. If you’d like it installed elsewhere, replace ‘/opt/local/ruby/’ below with your path.


login as root user

mkdir -p /opt/local/ruby
mkdir -p /opt/local/ruby/src

Download The Latest Ruby Tar Ball to obtain the URL of the tar gz file.

cd /opt/local/ruby/src

wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz

tar xvfz ruby-1.9.1-p243.tar.gz

./configure --prefix=/opt/local/ruby --disable-install-doc

make test (optional)

make && make install

Modify your PATH variable in ~/.bashrc file


export PATH=$PATH:/opt/local/ruby/bin
VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Installing Ruby 1.9.1 on Linux by Source Code, 5.0 out of 5 based on 1 rating
Facebook Twitter Email

Leave a Reply