Using rbenv - 02 Apr 2012
Making the switch to rbenv from rvm is pretty simple. Assuming you have homebrew installed, you’ll want to run the following commands.
brew install rbenv brew install ruby-build echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
That will get you started with the core rbenv components. You can now run rbenv install 1.9.3-p125
to install the latest version of Ruby. You’ll then want to run rbenv rehash
, as well as rbenv global 1.9.3-p125
to set 1.9.3 to your global Ruby version.
To take advantage of rbenv for your applications, you’ll want to use local versions. First you’ll need to navigate to the application directory, then run rbenv local your_ruby_version
to set the Ruby version for your project.
Bundler is a great tool for replacing RVM gemsets. When initially installing your gems, you should run bundle install --path vendor/bundle
to install your gems to a local directory. You’ll also want to add /vendor/bundle/
to your global .gitignore file. I’d also recommend creating an alias in your .bash_profile, alias binstall='bundle install --path vendor/bundle'
That’s it, you should be all set with rbenv and bundler.