Skip to content

Instantly share code, notes, and snippets.

@yrgoldteeth
Created February 7, 2013 17:05
Show Gist options
  • Save yrgoldteeth/4732437 to your computer and use it in GitHub Desktop.
Save yrgoldteeth/4732437 to your computer and use it in GitHub Desktop.
PACKAGES = %w( build-essential
wget
vim
git-core
curl
bison
openssl
libreadline6
libreadline6-dev
zlib1g
zlib1g-dev
libssl-dev
libyaml-dev
libxml2-dev
libxslt-dev
autoconf
libc6-dev
ncurses-dev
libcurl4-openssl-dev
libopenssl-ruby
libapr1-dev
libaprutil1-dev
libx11-dev
libffi-dev
libqt4-dev )
PACKAGES.map{|p| package p}
SOURCE_DIR = "/home/vagrant/src"
bash "create source directory" do
user "vagrant"
code <<-EOH
mkdir #{SOURCE_DIR}
EOH
not_if "test -d #{SOURCE_DIR}"
end
bash "download ruby 1.9.2p-290" do
user "vagrant"
code <<-EOH
cd #{SOURCE_DIR}
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
EOH
not_if "test -f #{SOURCE_DIR}/ruby-1.9.2-p290.tar.gz"
end
bash "extract, make, make install ruby" do
code <<-EOH
cd #{SOURCE_DIR}
tar -xzvf ruby-1.9.2-p290.tar.gz
cd ruby-1.9.2-p290
./configure
make
make install
EOH
not_if "ruby -v|grep p290"
end
bash "download rubygems" do
user "vagrant"
code <<-EOH
cd #{SOURCE_DIR}
wget http://rubyforge.org/frs/download.php/76073/rubygems-1.8.24.tgz
EOH
not_if "test -f #{SOURCE_DIR}/rubygems-1.8.24.tgz"
end
bash "extract and install rubygems" do
code <<-EOH
cd #{SOURCE_DIR}
tar -zxvf rubygems-1.8.24.tgz
cd rubygems-1.8.24
ruby setup.rb
EOH
not_if "gem -v|grep 1.8.24"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment