Factory_girl_railsというGemをRailsプロジェクトで使おうとして
rails sしたところ以下のようなエラーが出ました。
rails s DEPRECATION WARNING: The factory_girl gem is deprecated. Please upgrade to factory_bot. See https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md for further instructions. (called from <top (required)> at /Users/ユーザー 名/projects/chat-space/config/application.rb:7) /Users/ユーザー名/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/factory_bot- 4.11.1/lib/factory_bot/decorator.rb:10:in `method_missing': Factory already registered: user (FactoryBot::DuplicateDefinitionError) from /Users/ユーザー名/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/factory_bot- 4.11.1/lib/factory_bot/decorator/disallows_duplicates_registry.rb:6:in `register'
そこで、Factory_botに変わったらしいということがわかったので、factory_botでインストールし直して、Girlの記述をすべてBotに変えたらエラーの後半部分だけが残りました
/Users/yutotakai/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/factory_bot- 4.11.1/lib/factory_bot/decorator.rb:10:in `method_missing': Factory already registered: user (FactoryBot::DuplicateDefinitionError) from /Users/yutotakai/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/factory_bot- 4.11.1/lib/factory_bot/decorator/disallows_duplicates_registry.rb:6:in `register'
しかしこっちの方はあまり解決法がわからず....
どなたか教えていただけたら嬉しいです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。