Skip to content

Instantly share code, notes, and snippets.

@ngauthier
Created April 17, 2012 15:51
Show Gist options
  • Save ngauthier/2407031 to your computer and use it in GitHub Desktop.
Save ngauthier/2407031 to your computer and use it in GitHub Desktop.
ubuntu ruby with brightbox
# only bundler will be installed here
export GEM_HOME=/home/nick/.gems
# run this for new projects to put the gems and bins in the directory
alias bundle-bootstrap="bundle install --binstubs=.bundle/bin --path=.bundle/gems"
# switch to ruby 1.8
switch-ruby-1.8 ()
{
sudo update-alternatives --set ruby /usr/bin/ruby1.8
sudo update-alternatives --set gem /usr/bin/gem1.8
gem install bundler
}
export -f switch-ruby-1.8
# switch to ruby 1.9
switch-ruby-1.9.1 ()
{
sudo update-alternatives --set ruby /usr/bin/ruby1.9.1
sudo update-alternatives --set gem /usr/bin/gem1.9.1
gem install bundler
}
export -f switch-ruby-1.9.1
# have to re-install bundler to use the current ruby
# you could also use:
# ruby-switch --set ruby1.8
sudo apt-add-repository ppa:brightbox/ruby-ng-experimental
sudo apt-get update
sudo apt-get install ruby rubygems ruby-switch
sudo apt-get install ruby1.9.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment