Skip to content

Instantly share code, notes, and snippets.

@mustmodify
Forked from ryanb/chef_solo_bootstrap.sh
Created June 28, 2012 21:34
Show Gist options
  • Save mustmodify/3014073 to your computer and use it in GitHub Desktop.
Save mustmodify/3014073 to your computer and use it in GitHub Desktop.
Bootstrap Chef Solo with MRI 1.8.7
#!/usr/bin/env bash
# based on http://railscasts.com/episodes/339-chef-solo-basics?autoplay=true
# Some of my clients' projects are still on 1.8
# expects to be run on Ubuntu 12+
export RUBY_MAJOR_VER='1.8'
export RUBY_FULL_VER='ruby-1.8.7-p358'
export RUBY_GEMS_VERSION='1.6.2'
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev libmysqlclient-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/$RUBY_MAJOR_VER/$RUBY_FULL_VER.tar.gz
tar -xvzf $RUBY_FULL_VER.tar.gz
cd $RUBY_FULL_VER
./configure --prefix=/usr/local
make
make install
#and ruby 1.8 doesn't compile gems apparently
wget http://rubyforge.org/frs/download.php/74619/rubygems-1.7.2.tgz
tar -xzf rubygems-$RUBY_GEMS_VERSION.tgz
cd "rubygems-$RUBY_GEMS_VERSION"
ruby setup.rb install
cd .. && rm -rf rubygems-$RUBY_GEMS_VERSION && rm -rf rubygems-$RUBY_GEMS_VERSION.tgz
gem install chef ruby-shadow mysql bundler rake --no-ri --no-rdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment