Skip to content

Instantly share code, notes, and snippets.

@ricardodovalle
Forked from ninthspace/gist:4360267
Created November 16, 2013 02:47
Show Gist options
  • Save ricardodovalle/7495262 to your computer and use it in GitHub Desktop.
Save ricardodovalle/7495262 to your computer and use it in GitHub Desktop.

Remove rbenv and any rubies, gems etc.:

$ rm -rf ~/.rbenv

Uninstall rbenv if installed via Homebrew

$ brew uninstall rbenv

Remove references to rbenv in ~/.bash_profile etc.

Install chruby as per https://github.com/postmodern/chruby

For easy of use I decided to add the following to ~/.bash_profile

RUBIES=(/Users/chris/.rubies/rub*)
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh

The first line ensures I know where my rubies are installed, and the latter line auto-switches ruby versions, honouring the setting in .ruby-version when entering a directory.

Open a new shell so the above takes effect.

Install rubies via ruby-build https://github.com/sstephenson/ruby-build

Because I've now no gems, install Bundler

$ gem install bundler

At this stage, I still need project-specific gems. Previously I've used rbenv-gemset (and prior to that rvm's own management). Now I decided to just rely on Bundler.

So, go to each project and:

  • Switch to the required ruby using chruby
  • Put that ruby version in a .ruby-version file

Then Bundle as follows:

$ bundle install --path vendor
$ bundle package --all
$ echo 'vendor/ruby' >> .gitignore

Tips for the above came from http://ryan.mcgeary.org/2011/02/09/vendor-everything-still-applies/

Use bundle exec rails server etc., as before

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