Skip to content

Instantly share code, notes, and snippets.

@shyam
Created September 22, 2011 06:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shyam/1234201 to your computer and use it in GitHub Desktop.
Save shyam/1234201 to your computer and use it in GitHub Desktop.
Installing Ruby 1.9.x from source on Linux ( Debian/Ubuntu and RHEL/CentOS )
# Note: This script show how to compile ruby-1.9.2-p290. It can also be used for 1.9.3-p0 or higher versions.
#
# Dependencies
#
# Debian and derivatives:
# aptitude install build-essential libssl-dev libcurl4-openssl-dev libreadline5-dev zlib1g-dev libxslt1-dev libxml2-dev
# RHEL and derivatives:
# yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
## NOTE: For centos >= 5.4 iconv-devel is provided by glibc
cd /usr/src
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.bz2
tar xjf ruby-1.9.2-p290.tar.bz2
cd ruby-1.9.2-p290
./configure --enable-shared
make install
cd ext/openssl/
ruby extconf.rb
make install
cd ../readline/
ruby extconf.rb
make install
gem update --system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment