Skip to content

Instantly share code, notes, and snippets.

@isaksky
Created July 18, 2012 17:23
Show Gist options
  • Save isaksky/3137579 to your computer and use it in GitHub Desktop.
Save isaksky/3137579 to your computer and use it in GitHub Desktop.
Script to install rbenv and ruby-build
# Check out rbenv into ~/.rbenv.
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
# Add ~/.rbenv/bin to your $PATH for access to the rbenv command-line utility.
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
# Add rbenv init to your shell to enable shims and autocompletion.
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
# Restart your shell so the path changes take effect.
exec $SHELL
# Install ruby-build as an rbenv plugin, giving you access to the rbenv install command.
mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
# You can now begin using rbenv.
# For example:
# rbenv install 1.9.3-p194
# rbenv global 1.9.3-p194 #set global ruby version
# If you install evil gems that provide binaries, you need to this command for them to work properly:
# rbenv rehash
@isaksky
Copy link
Author

isaksky commented Jul 18, 2012

Run with:

 bash <(curl -s https://raw.github.com/gist/3137579)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment