Skip to content

Instantly share code, notes, and snippets.

@dannguyen
Last active December 16, 2015 08:29
Show Gist options
  • Save dannguyen/5406343 to your computer and use it in GitHub Desktop.
Save dannguyen/5406343 to your computer and use it in GitHub Desktop.
Setting up EC2 ruby 1.9.3

http://blog.astyran.sg/2012/01/installing-ruby-v193-on-amazon-ami.html

Using Amazon's AMI

ami-3275ee5b

Logging in

Set up .pem permissions

chmod 400 my.pem

ssh into instance

ssh -i my.pem -l ec2-user ubuntu@ec2-555-555-555-555.compute-1.amazonaws.com


Inside ssh

sudo yum groupinstall -y  'Development Tools' 
sudo yum groupinstall -y  development-libs
sudo yum install -y  libffi-devel
sudo yum install -y  libyaml-devel 

Run security updates

yum update

Remove Doxygen, reinstall

sudo su -
cd
yum remove doxygen
svn co https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk doxygen-svn
cd doxygen-svn
./configure
make
make install
cd
rm -r doxygen-svn

Use rb.env instead?

https://gist.github.com/juno/1330165

Might need to not be sudo while doing this...

Set up user-data: #!/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

Install rbenv

# 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

Get Ruby without rbenv

Make sure doxygen has been upgraded

wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar xzvf ruby-1.9.3-p392.tar.gz
cd ruby-1.9.3-p392
./configure
make
make install
make clean
gem update --system

Alternative rbenv setup, on local system with no reference to ec2

https://gist.github.com/sstephenson/1120938

Another script for ec2 and rbenv

http://www.danielstutzman.com/2012/09/rbenv-on-aws-ec2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment