I have a private git server hosting a gem we developed. The gem got some commits, but the version did not actually change.
How can I force bundler to update my gem even if the version hasn't changed?
I tried "bundler update mygemname" but it did not update anything.
Thanks
As @Tim's answer says, as of Bundler 1.14 the officially-supported way to this is with bundle update --conservative gem-name . Be careful, "updating gem and dependencies" means updating rails itself if it is a dependency and you probably don't want that. --source will only update the gem specified as parameter.
The correct way to update the version of a gem to a specific version is to specify the version you want in your Gemfile, then run bundle install . As for why your command line was failing, there is no -version option.
Upgrade a Ruby Gem to a Latest Version To upgrade a gem to the latest version, re-install the gem without specifying any version number. Running the above code on my machine upgrades my Rails to v7. To upgrade a gem to the latest version for a Ruby application, run bundle update gem-name .
you can also put the git hashref right in the Gemfile with the :ref
option
gem 'foo', :git => 'git://github.com/foobar/foo.git', :branch => '0.9-beta', :ref => '9af382ed'
especially useful if you don't have control over said gem, and keeps bundler from giving you a newer version in case there are breaking changes.
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