Rails7 bundle install時にエラー「Your Gemfile lists the gem turbo-rails (>= 0) more than once.」が発生した場合の対処法

  • 作成日 2024.06.28
  • rails
Rails7 bundle install時にエラー「Your Gemfile lists the gem turbo-rails (>= 0) more than once.」が発生した場合の対処法

bundle install時にエラー「Your Gemfile lists the gem turbo-rails (>= 0) more than once.」が発生した場合の対処法を記述してます。

環境

  • OS Ubuntu24.04
  • rails 7.1.3

エラー全文

$ bundle installに発生

$ bundle install
Your Gemfile lists the gem turbo-rails (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
Bundle complete! 15 Gemfile dependencies, 83 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

原因

「Gemfile」に「turbo-rails」が複数記載されていたため

対処法

複数記載されている「gem “turbo-rails”」を1つにする

gem "turbo-rails"