Skip to content

Instantly share code, notes, and snippets.

@vanhalt
Last active August 29, 2015 13:58
Show Gist options
  • Save vanhalt/10298110 to your computer and use it in GitHub Desktop.
Save vanhalt/10298110 to your computer and use it in GitHub Desktop.
Installing rbenv and ruby 2.0
curl -O https://gist.githubusercontent.com/vanhalt/10298110/raw/8b97e642bc1365cf5ac7854ea916af56b5ff2046/install_rbenv_and_ruby.sh && bash install_rbenv_and_ruby.sh
#/bin/bash
echo "Installing rbenv! in ubuntu the fastest way"
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo "Rbenv has been installed!"
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
echo "environment variables set, check rbenv: "
type rbenv
echo "Installing lastest ruby version"
rbenv install 2.0.0-p353
rbenv rehash
echo "Ruby version installed :)"
#/bin/bash
#stolen from https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer
RBENV_ROOT="$HOME/.rbenv"
# Install plugins:
PLUGINS=(
sstephenson/rbenv-vars
sstephenson/ruby-build
sstephenson/rbenv-default-gems
sstephenson/rbenv-gem-rehash
fesplugas/rbenv-installer
fesplugas/rbenv-bootstrap
rkh/rbenv-update
rkh/rbenv-whatis
rkh/rbenv-use
)
for plugin in ${PLUGINS[@]} ; do
KEY=${plugin%%/*}
VALUE=${plugin#*/}
RBENV_PLUGIN_ROOT="${RBENV_ROOT}/plugins/$VALUE"
if [ ! -d "$RBENV_PLUGIN_ROOT" ] ; then
git clone https://github.com/$KEY/$VALUE.git $RBENV_PLUGIN_ROOT
else
cd $RBENV_PLUGIN_ROOT
echo "Pulling $VALUE updates."
git pull
fi
done
mkdir -p ~/code/ruby && git clone https://github.com/neo/ruby_koans.git ~/code/ruby/ruby_koans && cd ~/code/ruby/ruby_koans && rake gen && rake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment