Advice on updating gems

I’ve just been battling with a deployment to heroku.

The error that stopped me for ages was

“You have already activated rake 0.9.2.2, but your Gemfile requires rake
0.9.2. Using bundle exec may solve this.”

I eventually managed to solve this by uninstaling rake 0.9.2
adding rake 0.9.2.2 to my gem file
then prompted by the command line a ran:
bundle update rake

“bundle update rake” Seemed to do a lot of things I wasn’t expecting,
going through all gems in the app, updating / installing newer versions
of them. This did solve the deployment problem, but I noticed the
printout from heroku indicated a lot of new installs of gems on the
server as well, updating to newer versions.

So far I haven’t noticed anything going wrong, but the fact that so many
gems have been updated / re installed worries me.

How do people go about making sure that when rails decides to update
everything things don’t break? I’ve definitely had new versions of gems
break apps before.

I’ve read that some processes depend on earlier versions of rake, can
anywhere tell me what depends on this, so I can check if it’s going to
break things?

Any advice / approaches on the constant update turmoil would really be
appreciated

The command you ran doesn’t do what you think it does. It actually
just ignored “rake” in the arguments and updated all your
dependencies to their latest versions.

From the bundler help:

bundle update(1) bundle-update.1.html
Update dependencies to their latest versions

In the future, just continue to manage your gem versions in your
gemfile as always specifying min, max, or fixed versions as needed.
However, instead of running “bundle update”, just run “bundle install”
and it will pick up your changes and apply them.

I would also recommend giving RVM a try if you’re not using it
already. With RVM you have the ability to create gemsets for each of
your apps and run multiple versions of ruby on the same machine. This
helps avoid conflicts when you’re working in multiple projects or
multiple versions of a project.

One other really nice benefit is that you can easily empty/clean out
your gemset and rebuild it from your gemfile if you ever get in a
situation like this on your local dev box.

RVM
https://rvm.beginrescueend.com/

Gemsets
https://rvm.beginrescueend.com/gemsets/