bundler installing gems into the rails root directory

I’m working on the new blenderbox.com website and we’re doing it in rails 3. I’ve had a great experience with rails 3 so far and all of the changes are really great. However, I ran bundle install from my root directory today and all of a sudden, my bundler installed all of my gems into my root directory with the message

Your bundle was installed to 'rails'

Instead of my expected rvm gemset, the gems were installed into ‘rails.’

After much hair pulling, I was finally able to get bundler to install into my gemset by running the following command.

rm -rf ~/.bundle/ ~/.gem/ .bundle/ Gemfile.lock
bundle install

Hope this helps someone out there.

Comments

    Nicholas |

    Thank you, thank you, thank you.

    I also had to unlink a cache link in one of my RVM directories – but then it all worked itself out. Any ideas why this suddenly occurred?

    Matthew |

    Thanks, I was suffering from this as well. I may have caused it by accidentally running “bundle install rails” rather than “bundle update rails” when moving from rc4 to rc5. It became even more confusing because I was specifying a git repo version of a gem in my Gemfile. Thus bundler started putting everything into a directory named after that gem.

    Thanks for posting this fix.

    ichibod |

    Amazing! Thanks!