4 ms·
That's what bundle update does, with no other arguments. The other way to use it is bundle update gem-name, which will only update the gem passed in and it's de
by ajsharp 16y ago
That's what bundle update does, with no other arguments. The other way to use it is bundle update gem-name, which will only update the gem passed in and it's dependencies.
- grandalf 16y agoIt doesn't update the version numbers in the Gemfile, though, does it? IOW it's only for gems that you haven't locked in a specific version for? I'd love to be able to ask bundler which of the gems that I have locked in a version for have a newer version available, so that I can test and decide if I should update.
- JonnieCache 16y agoYes, a `bundle update --pretend` switch or similar would be good.
- ajsharp 16y agoNo, it won't update the version numbers in your Gemfile. But to be clear, let's assume you have the following in your Gemfile: gem "rails", "3.0.0" gem "formtastic", ">=1.0.0" Running bundle update (with no arguments) won't update the rails gem to a more recent version (if it exists), but it will update any of rails' dependencies, if updates exist. So, rails has a "specific" dependency on actionpack = 3.0.0, and actionpack 3.0.0 has a dependency on erubis ~> 2.6.6. Let's say (hypothetically) the most recent published version of erubis is 2.6.7 (which matches the ~> operator), but the version in your Gemfile.lock is 2.6.6, running bundle update will pull down that new version of erubis 2.6.7. Similarly, if a newer version of formtastic were available than the one in your Gemfile.lock, bundle update would pull this down as well.
- JonnieCache 16y agoThe ~> operator is the only one you should really use in your Gemfile version strings. Never >= See this post by yehuda katz (bundle developer): http://yehudakatz.com/2010/08/21/using-considered-harmful-or-whats-wrong-with/ http://yehudakatz.com/2010/08/21/using-considered-harmful-or... You can actually use `bundle update` pretty safely with judicious use of ~>
- grandalf 16y agoIn general I have varying levels of confidence in whether I want to stay at the latest version of a gem or not. I also don't want to have to constantly check to see if the gems for which I've fixed the version are the latest... During development I'd be inclined to keep most gems at the latest version (barring the sort of conflict you describe), but once the app is in production I'd be likely to be more cautious, read the changelog, etc., before updating. It's just that when there are a lot of gems in use, it becomes time consuming to have to cross-reference the lastest version of each gem whose version I have fixed with the latest released version. It seems that Bundler is the natural place for this functionality to live.