Skip to content

Instantly share code, notes, and snippets.

@loopj
Created June 17, 2012 03:59
Show Gist options
  • Select an option

  • Save loopj/2943363 to your computer and use it in GitHub Desktop.

Select an option

Save loopj/2943363 to your computer and use it in GitHub Desktop.
Install Ruby 1.9 on Ubuntu 12.04
#!/bin/sh
# Make sure we have the latest package info
apt-get update
# Install ruby 1.9 and some other useful related packages
apt-get install -y ruby1.9.3 build-essential libssl-dev zlib1g-dev
# Let "update-alternatives" know about the new ruby
update-alternatives \
--install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
/usr/share/man/man1/ruby1.9.1.1.gz \
--slave /usr/bin/ri ri /usr/bin/ri1.9.1 \
--slave /usr/bin/irb irb /usr/bin/irb1.9.1 \
--slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1
# Make 1.9 the default
update-alternatives --config ruby
update-alternatives --config gem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment