Skip to content

Instantly share code, notes, and snippets.

@amedrz
Created May 9, 2012 19:44
Show Gist options
  • Save amedrz/2648295 to your computer and use it in GitHub Desktop.
Save amedrz/2648295 to your computer and use it in GitHub Desktop.
Installing rbenv on Mac OS X

Basic GitHub Checkout

This will get you going with the latest version of rbenv and make it easy to fork and contribute any changes back upstream.

  1. Check out rbenv into ~/.rbenv.

     $ cd
     $ git clone git://github.com/sstephenson/rbenv.git .rbenv
    
  2. Add ~/.rbenv/bin to your $PATH for access to the rbenv command-line utility.

     $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
    
  3. Add rbenv init to your shell to enable shims and autocompletion.

     $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
    
  4. Restart your shell so the path changes take effect. You can now begin using rbenv.

     $ source ~/.bash_profile
    
  5. Install ruby-build locally as a rbenv plugin:

     $ mkdir -p ~/.rbenv/plugins
     $ cd ~/.rbenv/plugins
     $ git clone git://github.com/sstephenson/ruby-build.git
     $ cd ~/.rbenv/plugins/ruby-build
     $ sudo ./install.sh
    
  6. Install any ruby version with the built in rbenv-install command:

     $ rbenv install 1.9.2-p290
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment