Skip to content

Instantly share code, notes, and snippets.

@meonkeys
Forked from stupidbodo/Install Ruby Centos 6
Last active December 27, 2015 17:09
Show Gist options
  • Save meonkeys/7360578 to your computer and use it in GitHub Desktop.
Save meonkeys/7360578 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install Ruby Centos 6 #
#################
# MUST BE RUN AS ROOT
set -o xtrace
cd /tmp
#Remove old Ruby
yum -y remove ruby
# Install dependencies
yum -y groupinstall "Development Tools"
yum -y install zlib zlib-devel
yum -y install openssl-devel
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar xzvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make
make install
# Install ruby
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar zxf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194
./configure
make
make install
# Update rubygems
gem update --system
gem install bundler
#Test ruby and rubygems are working
#Close shell and reopen for changes to take effect
ruby -v
gem --version
# Rails
yum -y install sqlite-devel
gem install rails
gem install sqlite3
# could just fix the `make install` above to use the prefix `/usr`, but I'm too lazy to try/test it
cd /usr/bin
ln -s /usr/local/bin/ruby
ln -s /usr/local/bin/gem
@iameli
Copy link

iameli commented Nov 8, 2013

Can take out lines 44-46 if you want, we don't need Rails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment