Skip to content

Instantly share code, notes, and snippets.

@mhayes
Created June 6, 2012 15:44
Show Gist options
  • Select an option

  • Save mhayes/2882781 to your computer and use it in GitHub Desktop.

Select an option

Save mhayes/2882781 to your computer and use it in GitHub Desktop.
Bootstrap RHEL6 box
#!/bin/bash
# bootstrap ruby on a fresh RHEL6.0
# Rackspace appears to mount /tmp as `noexec` which
# doesn't allow ruby-build to install ruby (since packages)
# downloaded can't be executed from /tmp so reassign
# the tmp directory
if [ ! -d "$HOME/tmp" ]; then
mkdir "$HOME/tmp"
fi
export TMPDIR="$HOME/tmp"
echo "Install development tools"
yum groupinstall 'Development Tools' -y
yum install readline-devel openssl-devel git -y
RUBY_VERSION=1.9.3-p194
RUBY_BUILD_REPO=git://github.com/sstephenson/ruby-build.git
RUBY_BUILD_TAG=e69f559c7edcd2b49d0e27c662ac923391544bcf
RUBY_BUILD_PATH=/tmp/ruby-build
if [ ! -d "$RUBY_BUILD_PATH" ]; then
git clone $RUBY_BUILD_REPO $RUBY_BUILD_PATH
fi
echo "Checking out ruby-build ($RUBY_BUILD_TAG)"
cd $RUBY_BUILD_PATH && \
git pull origin master && \
git checkout $RUBY_BUILD_TAG
echo "$RUBY_BUILD_PATH/install.sh"
# Installs to /usr/local/bin which is NOT part of
# root user PATH
sh "$RUBY_BUILD_PATH/install.sh"
# Install ruby
if [ ! -f "" ]; then
if [echo `ruby -v` | grep $RUBY_VERSION | wc -l -gt 0]
/usr/local/bin/ruby-build $RUBY_VERSION /usr
fi
echo "Updating rubygems"
gem update --system
echo "Installing chef client"
gem install chef --no-rdoc --no-ri
echo "Installing bundler"
gem install bundler --no-rdoc --no-ri
echo "You are now ready to be conquer the world!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment