Skip to content

Instantly share code, notes, and snippets.

@avsej
Created December 23, 2009 15:22
Show Gist options
  • Save avsej/262570 to your computer and use it in GitHub Desktop.
Save avsej/262570 to your computer and use it in GitHub Desktop.
Configure ubuntu/debian alternatives for ruby
#!/bin/sh
# at first you should remove gem alternative if it exists
# update-alternatives --remove-all gem
update-alternatives --remove-all ruby
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 500 \
--slave /usr/bin/ri ri /usr/bin/ri1.8 \
--slave /usr/bin/erb erb /usr/bin/erb1.8 \
--slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.8 \
--slave /usr/bin/gem gem /usr/bin/gem1.8 \
--slave /usr/bin/irb irb /usr/bin/irb1.8 \
--slave /etc/bash_completion.d/gem bash_completion_gem \
/etc/bash_completion.d/gem1.8 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
/usr/share/man/man1/ruby1.8.1.gz \
--slave /usr/share/man/man1/gem.1.gz gem.1.gz \
/usr/share/man/man1/gem1.8.1.gz \
--slave /usr/share/man/man1/erb.1.gz erb.1.gz \
/usr/share/man/man1/erb1.8.1.gz \
--slave /usr/share/man/man1/irb.1.gz irb.1.gz \
/usr/share/man/man1/irb1.8.1.gz \
--slave /usr/share/man/man1/ri.1.gz ri.1.gz \
/usr/share/man/man1/ri1.8.1.gz #\
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
--slave /usr/bin/ri ri /usr/bin/ri1.9.1 \
--slave /usr/bin/erb erb /usr/bin/erb1.9.1 \
--slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1 \
--slave /usr/bin/gem gem /usr/bin/gem1.9.1 \
--slave /usr/bin/irb irb /usr/bin/irb1.9.1 \
--slave /etc/bash_completion.d/gem bash_completion_gem \
/etc/bash_completion.d/gem1.9.1 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
/usr/share/man/man1/ruby1.9.1.1.gz \
--slave /usr/share/man/man1/gem.1.gz gem.1.gz \
/usr/share/man/man1/gem1.9.1.1.gz \
--slave /usr/share/man/man1/erb.1.gz erb.1.gz \
/usr/share/man/man1/erb1.9.1.1.gz \
--slave /usr/share/man/man1/irb.1.gz irb.1.gz \
/usr/share/man/man1/irb1.9.1.1.gz \
--slave /usr/share/man/man1/ri.1.gz ri.1.gz \
/usr/share/man/man1/ri1.9.1.1.gz \
--slave /usr/share/man/man1/rake.1.gz rake.1.gz \
/usr/share/man/man1/rake1.9.1.1.gz
update-alternatives --install /usr/bin/ruby ruby /usr/local/bin/rubygit 400 \
--slave /usr/bin/ri ri /usr/local/bin/rigit \
--slave /usr/bin/erb erb /usr/local/bin/erbgit \
--slave /usr/bin/rdoc rdoc /usr/local/bin/rdocgit \
--slave /usr/bin/gem gem /usr/local/bin/gemgit \
--slave /usr/bin/irb irb /usr/local/bin/irbgit \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
/usr/local/man/man1/rubygit.1 \
--slave /usr/share/man/man1/erb.1.gz erb.1.gz \
/usr/local/man/man1/erbgit.1 \
--slave /usr/share/man/man1/irb.1.gz irb.1.gz \
/usr/local/man/man1/irbgit.1 \
--slave /usr/share/man/man1/ri.1.gz ri.1.gz \
/usr/local/man/man1/rigit.1 \
--slave /usr/share/man/man1/rake.1.gz rake.1.gz \
/usr/local/man/man1/rakegit.1
# add to ~/.bashrc
# PATH="$(gem env gemdir)/bin:$PATH"
# vim:et:ts=8:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment