Travis CI build fails: Could not find XXX in any of the sources
-
01-07-2021 - |
Pregunta
I'm using Travis CI for a rails project, and I'm getting a "Could not find foobar-0.2.3 gem in any of the sources." at the bundle install
stage. (sorry, not at my computer right now, and don't remember the exact gem)
It looks like this is because a new version of that gem was recently put on RubyGems, and the old version of the gem (which is in my Gemfile.lock) was yanked.
How am I supposed to fix this break? Am I supposed to manually go into my Gemfile.lock and put the correct version? (Manually editing the Gemfile.lock seems weird to me, not sure if that's what you're supposed to do.)
Solución
It's never wise to manually edit your lockfile, as you can't know what has changed with the gem in question, it might have added dependencies for example.
If you use bundle update gemname
Bundler will update that gem to the latest available version and automatically update your Gemfile.lock. You can also manually specify a version in the Gemfile and run bundle install
.