Last active
August 29, 2015 14:07
-
-
Save yeban/df12d4ed1e624c64d023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -x | |
cd | |
# Download chruby to ~/.chruby. | |
wget -O /tmp/chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz | |
tar xvf /tmp/chruby-0.3.9.tar.gz -C /tmp | |
rm /tmp/chruby-0.3.9.tar.gz | |
rm -rf .chruby | |
mv /tmp/chruby-0.3.9/ .chruby | |
set +x | |
# Source chruby in the current shell. | |
source $HOME/.chruby/share/chruby/chruby.sh | |
set -x | |
# Add chruby to bashrc or zshrc as appropriate. | |
if [ -n "$BASH_VERSION" ]; then | |
echo $HOME/.chruby/share/chruby/chruby.sh >> ~/.bashrc | |
fi | |
if [ -n "$ZSH_VERSION" ]; then | |
echo $HOME/.chruby/share/chruby/chruby.sh >> ~/.zshrc | |
fi | |
# Download ruby-install to ~/.ruby-install. | |
wget -O /tmp/ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz | |
tar xvf /tmp/ruby-install-0.5.0.tar.gz -C /tmp | |
rm /tmp/ruby-install-0.5.0.tar.gz | |
rm -rf .ruby-install | |
mv /tmp/ruby-install-0.5.0/ .ruby-install | |
# Run ruby-install to install latest, stable Ruby. Will ask password to install | |
# dependencies. | |
.ruby-install/bin/ruby-install ruby |
yannickwurm
commented
Feb 25, 2015
- didn't work when wget wasn't installed (some macs)
- some bash read only ~/.profile rather than ~/.bashrc
- didn't work on eckart's biolinux either. (and I checked: sudo apt-get install chruby didn't work either)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment