Skip to content

Instantly share code, notes, and snippets.

@SammyLin
Forked from bladelee/setup ruby2.0 and chef-solo
Last active August 29, 2015 14:21
Show Gist options
  • Save SammyLin/2a4385d5ea4987b15bc8 to your computer and use it in GitHub Desktop.
Save SammyLin/2a4385d5ea4987b15bc8 to your computer and use it in GitHub Desktop.
setup ruby2.0 and chef-solo
sudo apt-get -y update
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim
# Download and compile Ruby 2.0.0-p0
cd /tmp
#wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
wget http://ruby.taobao.org/mirrors/ruby/2.0/ruby-2.0.0-p353.tar.gz
tar -xvzf ruby-2.0.0-*.tar.gz
cd ruby-2.0.0-*
./configure --prefix=/usr/local
make
make install
# Download and build Chef compatible with Ruby 2.0
cd /tmp
curl -o chef.tar.gz -L https://api.github.com/repos/opscode/chef/tarball
tar -xvzf chef.tar.gz
cd opscode-chef-*
sudo gem build chef.gemspec
gem source -a http://mirrors.aliyun.com/rubygems/
gem source -r https://rubygems.org/
sudo gem install chef-11.*.gem --no-ri --no-rdoc
# The rest
sudo gem install ruby-shadow --no-ri --no-rdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment