Don't run 'bundle install {gem}'

Don't run 'bundle install {gem}'
Photo by Michael Dziedzic / Unsplash

TL;DR: bundle install != gem install

Maybe you want to update haml to the latest version. You tried to run bundle install haml, but now some really weird stuff is happening. Bundler decided to install all of your gems from scratch into a ./haml folder. Even when you try bundle update haml, the gems are still going into the ./haml folder! What's going on?

bundle install haml is totally different to bundle update haml. It's also totally different to gem install haml.

What bundle install haml does:

  1. Installs all of your gems into a 'haml' folder. (creates the folder if it doesn't exist)
  2. Saves the  'haml' path in .bundle/config, so that it becomes your default gem folder for every bundle command you run in the future.

If you made this mistake and want to reset everything back to normal, just run:

rm -rf {gem} .bundle/config

Then, to update your gem, you should run:

bundle update {gem}