Install rbenv and ruby-build to Amazon Linux (cloud-init).
- Copy & paste content of
user-data.sh
to EC2 RunInstances user-data - 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 |