rbenv: Surviving without gemsets

Most people solve this by installing the rails gem first via gem install rails. If you refuse to do that for some reason, you can opt out of the automatic bundling that Rails attempts to do for you. This will work completely regardless of your ruby management system.

mkdir myapp
cd myapp
echo "source :rubygems" > Gemfile
echo "gem 'rails', '3.2.2'" >> Gemfile
bundle install --path vendor/bundle
bundle exec rails new . --skip-bundle

When prompted, type “y” to replace your Gemfile with the default Rails one (or not, as you prefer). Then, once it’s done:

bundle install

You’re done, and you have boostrapped a new rails app with the version of your choice without installing the rails gem into rubygems.

Leave a Comment