1

I created a ruby gem. And I made a change to it. But I did not change any of its development or runtime dependencies. After I made a change to the gem and pushed it to git, I then run bundle update --source on the Rails project that is using the gem:

bundle update --source my_gem

My expectation is that it will just update my_gem and nothing else. However, I found it is updating several other gems in Gemfile.lock of my Rails project:

-    google-cloud-core (1.2.6)
+    google-cloud-core (1.2.7)

-    google-cloud-env (1.0.4)
+    google-cloud-env (1.0.5)

-    google-cloud-vision (0.30.3)
+    google-cloud-vision (0.30.4)

-    signet (0.9.1)
+    signet (0.9.2)

Now yes my gem depends on google cloud. However, I did not update google cloud in my gem. I just updated one line of code in my gem itself. Why is it updating other gems and how can I prevent this?

Daniel Viglione
  • 8,014
  • 9
  • 67
  • 101

1 Answers1

0

I think you want bundle update --conservative --source my_gem

Jon Wolski
  • 2,293
  • 2
  • 19
  • 21
  • This gives error: Unknown switches '--conservative' – Daniel Viglione Sep 23 '18 at 21:41
  • Sorry. I should have tried it before posting. That's switch is documented on the `bundle update` documentation, but it is only documented for the `bundle install` sub-command. I'm not sure if I should delete my answer, or just leave it and down-vote it as a warning for others. – Jon Wolski Sep 24 '18 at 22:29
  • According to https://stackoverflow.com/questions/11263150/update-just-one-gem-with-bundler?rq=1, `--conservative` is the flag you need, but, you need `bundler` version `>= 1.14` – Jon Wolski Sep 24 '18 at 22:35
  • I am using bundler (1.7.12) – Daniel Viglione Sep 26 '18 at 00:29