Skip to content

Instantly share code, notes, and snippets.

@juno
Created November 1, 2011 08:40
Show Gist options
  • Save juno/1330165 to your computer and use it in GitHub Desktop.
Save juno/1330165 to your computer and use it in GitHub Desktop.
Install rbenv and ruby-build to Amazon Linux (cloud-init).

Install rbenv and ruby-build to Amazon Linux (cloud-init).

  1. Copy & paste content of user-data.sh to EC2 RunInstances user-data
  2. Then, logging in to EC2 instance as ec2-user and run install-ruby.sh.
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Install and enable ruby-1.9.3-p0
rbenv install 1.9.3-p0 && rbenv global 1.9.3-p0
#!/bin/sh
# Install developer tools
yum install -y git gcc make readline-devel openssl-devel
# Install ruby-build system-widely
git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
cd /tmp/ruby-build
./install.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment