Gemfileを書き換えた後にbundle installしたら以下のエラー。
$ bundle update
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Bundler could not find compatible versions for gem "actionpack":
In snapshot (Gemfile.lock):
actionpack (>= 6.1.4)
In Gemfile:
rails (= 6.0.3) was resolved to 6.0.3, which depends on
actionpack (= 6.0.3)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
bundle updateするといいらしいのでやってみたが同じエラーが出た。
bundle cleanup や gem cleanup も試したが駄目だった。
解決
Gemfile.lockを削除するという方法で解決した。まさかこんな強引な方法でうまくいくとは思ってなかった。
$ rm Gemfile.lock $ bundle update Fetching gem metadata from https://rubygems.org/............ Resolving dependencies.... Fetching rake 12.3.3 Installing rake 12.3.3 (略) Bundle updated! $ bundle install Using rake 12.3.3 (略) Bundle complete! 18 Gemfile dependencies, 75 gems now installed.