Created
August 20, 2014 15:35
-
-
Save mdeltito/0b46842636c03acf7df5 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
#!/bin/bash | |
NODE_VERSION='0.10' | |
RUBY_VERSION='2.0.0-p481' | |
if [ ! -d ~/.nvm ]; then | |
echo "Installing nvm..." | |
git clone https://github.com/creationix/nvm.git ~/.nvm | |
echo -e "\n# nvm\n source ~/.nvm/nvm.sh" >> ~/.bash_profile | |
fi | |
source ~/.bash_profile | |
echo "Installing node v$NODE_VERSION..." | |
nvm install $NODE_VERSION | |
nvm alias default $NODE_VERSION | |
echo "Node installed at `which node`" | |
if [ ! -d ~/.rbenv ]; then | |
echo "Installing rbenv..." | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo -e "\n# rbenv\n" >> ~/.bash_profile | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
fi | |
source ~/.bash_profile | |
echo "Installing ruby v$RUBY_VERSION..." | |
rbenv install $RUBY_VERSION | |
rbenv global $RUBY_VERSION | |
echo "YAY!" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment