Skip to content

Instantly share code, notes, and snippets.

@ralph
Created October 28, 2010 15:32
Show Gist options
  • Save ralph/651597 to your computer and use it in GitHub Desktop.
Save ralph/651597 to your computer and use it in GitHub Desktop.
Enter the following script as user data while firing up new instances and you will find a basic ruby environment, e.g. in order to start your chef provisioning.
#!/bin/bash
yum -y install make gcc-c++ zlib-devel openssl-devel
yum -y install ruby-devel ruby-irb ruby-rdoc ruby-ri
cd /tmp
curl -O http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xfz rubygems-1.3.7.tgz
ruby rubygems-1.3.7/setup.rb
gem install chef ohai --no-rdoc --no-ri
mkdir /etc/chef
chown ec2-user:ec2-user /etc/chef
Host *.compute.amazonaws.com
User ec2-user
IdentityFile ~/.ssh/testing.pem
#!/bin/bash
# Find AMIs here:
# http://uec-images.ubuntu.com/releases/lucid/release/
apt-get update
apt-get -y install ruby ruby-dev libopenssl-ruby rdoc ri irb build-essential wget ssl-cert rubygems1.8
gem install chef ohai --no-rdoc --no-ri
mkdir /etc/chef
chown ubuntu:ubuntu /etc/chef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment