When trying to do a fresh bundle install of shoulda-matchers from git we get the following failure:
Fetching https://github.com/thoughtbot/shoulda-matchers.git
fatal: Could not parse object 'f800d62525a65f9bf001ea984ae4926a92ff5b82'.
Git error: command `git reset --hard f800d62525a65f9bf001ea984ae4926a92ff5b82` in directory /private/tmp/bundle/ruby/2.4.0/bundler/gems/shoulda-matchers-f800d62525a6 has failed.
If this error persists you could try removing the cache directory '/tmp/bundle/ruby/2.4.0/cache/bundler/git/shoulda-matchers-e04e9ade87805b3667f97d976fd84556605e66f8'
The import in our gemfile is:
gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'
Our Gemfile.lock contains the following info for shoulda-matchers:
remote: https://github.com/thoughtbot/shoulda-matchers.git
revision: f800d62525a65f9bf001ea984ae4926a92ff5b82
branch: rails-5
Was there a force-push that may have removed this commit recently?
We believe that we can solve this issue by running a bundle update, but just wanted to start the discussion here.
We first saw this issue in circle CI when running the bundle-install step on a fresh install of our app. We were able to reproduce locally by running bundle install --path [some path we know doesn't have existing bundled gems]. In this case we used /tmp/bundle.
Thanks, @cweems and @zaksoup
Yes, we rebased rails-5 and then merged it into master. Sorry for the mess -- it won't happen again!
@mcmire thanks!
For anyone else who found this, we fixed this by deleting the revision sha from our Gemfile.lock and re-ran bundle install.
Thank you for posting the solution @cweems !
Be advised that we will remove rails-5 at a certain point, so I would recommend switching to master now if you really want to continue being on the bleeding edge :)
Oh ok @mcmire so rails-5 has been merged with master already then? Has it been released too, or should we just point to master at this point?
@zachfeldman We haven't released the next version yet, but we're not doing any more work for 3.x, so it made more sense to pull everything into master and use that from now on for future work. So you should be able to switch to that until we release 4.0.
Great thank you!
Sorry, am new to all of this,
At this point, a better fix would be to change
gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'
to
gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'master'
How does this affect my Gemfile.lock which still has the revision sha
@Subomi Yup, that's correct. You will get a new SHA when you make that change.
Okay, thanks .. works now.
@cweems deleting the SHA from Gemfile.lock and rerunning bundle install worked for me, thank you! :octocat:
Most helpful comment
@mcmire thanks!
For anyone else who found this, we fixed this by deleting the revision sha from our
Gemfile.lockand re-ranbundle install.