I have a Ruby on Rails application and I'm using Ruby Version Manager. Can I update gems using either bundle update
or gem update
? Are they doing the same thing?
The main difference is that Rubygems (invoked with the command gem
) manages all the gems (gemsets if you are using RVM) for a single machine, whereas Bundler (bundle
) manages a gem set for a single application (its purpose being to deploy on multiple machines).
The Ruby Version Manager (rvm
) only eases the task of managing different gem versions on the same machine, but it's not application-related unless you want to name a gemset for a particular application (see named gemsets).
Both will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources. However Bundler, unlike Rubygems, will only update gems and dependencies specified in the application's Gemfile
, complying with its restrictions (version numbers and spermises).
That said, you should use bundle install
instead of bundle update
, to be sure you are installing the same exact gems and versions across machines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With