Skip to content

Instantly share code, notes, and snippets.

@liamjbennett
Last active May 24, 2016 15:29
Show Gist options
  • Save liamjbennett/488dd0b43be900c68b414f87425acfbd to your computer and use it in GitHub Desktop.
Save liamjbennett/488dd0b43be900c68b414f87425acfbd to your computer and use it in GitHub Desktop.
ruby2.0 centos/rhel
#!/usr/bin/env bash
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
version=2.0.0-p247
cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-$version.tar.gz
tar zxvf ruby-$version.tar.gz
cd ruby-$version
./configure
curl -fsSL "https://github.com/ruby/ruby/commit/0d58bb55985e787364b0235e5e69278d0f0ad4b0.patch" | filterdiff -x a/ChangeLog -x a/test/openssl/test_pkey_ec.rb | patch ext/openssl/ossl_pkey_ec.c
make
make install
version=2.0.7
cd ..
wget http://production.cf.rubygems.org/rubygems/rubygems-$version.tgz
tar zxvf rubygems-$version.tgz
cd rubygems-$version
/usr/local/bin/ruby setup.rb
alternatives --set ruby /usr/local/bin/ruby
alternatives --set gem /usr/local/bin/gem
alternatives --set erb /usr/local/bin/erb
alternatives --set irb /usr/local/bin/irb
gem install bundler --no-ri --no-rdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment