Skip to content

Instantly share code, notes, and snippets.

@ealden
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ealden/18123ae72f3b0a4f52f4 to your computer and use it in GitHub Desktop.
Save ealden/18123ae72f3b0a4f52f4 to your computer and use it in GitHub Desktop.
Ruby install in CentOS 6.5
# Install required packages in CentOS 6
# This should be run as root
yum install gcc make zlib zlib-devel readline-devel openssl-devel git
# Install rbenv
# This should be run as a non-root user
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
# Install ruby-build
# This should be run as a non-root user
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# Install latest Ruby and set it as global
# This should be run as a non-root user
rbenv install 2.1.3
rbenv global 2.1.3
# Install bundler as we always need it
# This should be run as a non-root user
gem install bundler
# Install required packages for nokogiri
# This should be run as root
yum install libxml2-devel libxslt-devel
# CentOS 6.5 has an older version of libxml2 which causes `gem install nokogiri` to fail
# We set Bundler to use the system libraries when compiling Nokogiri
# This should be run as a non-root user
bundle config build.nokogiri "--use-system-libraries"
# root: Install required packages for pg
# For PostgreSQL 9.3
# This should be run as root
yum install postgresql93-devel
# Install required packages for therubyracer
# This is necessary if your app has ActionView/Sprockets
# This should be run as root
yum install gcc-c++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment