エラー内容
everyday-rspecで勉強してる中で、bundle installしたらコケた。
エラーで言っているように、rm -rfで cache以下を削除して再度bundle installしても解決せず。
h2tomo:everydayrails-rspec-2017 tomohiro$ bundle Fetching gem metadata from https://rubygems.org/........... Fetching https://github.com/thoughtbot/shoulda-matchers.git fatal: Could not parse object '0b2e0da6035b9c45b0430bc6eb9a8bab4aeba50e'. Git error: command `git reset --hard 0b2e0da6035b9c45b0430bc6eb9a8bab4aeba50e` in directory /Users/tomohiro/work/everydayrails-rspec-2017/vendor/cache/bundler/gems/shoulda-matchers-0b2e0da6035b has failed. If this error persists you could try removing the cache directory '/Users/tomohiro/work/everydayrails-rspec-2017/vendor/cache/cache/bundler/git/shoulda-matchers-e04e9ade87805b3667f97d976fd84556605e66f8' h2tomo:everydayrails-rspec-2017 tomohiro$ cd vendor/cache/cache/bundler/git/ h2tomo:git tomohiro$ ls shoulda-matchers-e04e9ade87805b3667f97d976fd84556605e66f8 h2tomo:git tomohiro$ rm -rf shoulda-matchers-e04e9ade87805b3667f97d976fd84556605e66f8
解決策
Gemfile.lockのrevision:~
の箇所を削除し、bundle install --path vendor/bundle
を実行する
GIT remote: https://github.com/thoughtbot/shoulda-matchers.git revision: 0b2e0da6035b9c45b0430bc6eb9a8bab4aeba50e branch: rails-5 specs: shoulda-matchers (3.1.2) activesupport (>= 4.2.0)