前提・実現したいこと
Railsチュートリアル学習中のものです。現在14.2.5のfollowボタンの部分を進めていてその最後にrails testコマンドを打ち込むはずが誤ってrails generate controller Relationshipsコマンドを打ち込んでしまいました。
リンク内容
その後はconflictが下記2件の箇所で起こりました。
conflict app/controllers/relationships_controller.rb
Overwrite /home/ec2-user/environment/sample_app/app/controllers/relationships_controller.rb? (enter "h" for help) [Ynaqdhm]
conflict test/controllers/relationships_controller_test.rb
Overwrite /home/ec2-user/environment/sample_app/test/controllers/relationships_controller_test.rb? (enter "h" for help) [Ynaqdhm]
この際にEnterをおして抜けてしまったのですが、その後rails testを打ち込むとエラーが起きました。
この場合はどのように対処すればよろしいでしょうか?
発生している問題・エラーメッセージ
ERROR["test_should_unfollow_a_user_with_Ajax", FollowingTest, 2.092911899000228] test_should_unfollow_a_user_with_Ajax#FollowingTest (2.09s) ActionView::Template::Error: ActionView::Template::Error: undefined method `id' for nil:NilClass app/views/users/_follow.html.erb:2:in `block in _app_views_users__follow_html_erb___1827588714319501049_64435160' app/views/users/_follow.html.erb:1:in `_app_views_users__follow_html_erb___1827588714319501049_64435160' app/views/relationships/destroy.js.erb:1:in `_app_views_relationships_destroy_js_erb___2200646867196533539_64421200' test/integration/following_test.rb:53:in `block (2 levels) in <class:FollowingTest>' test/integration/following_test.rb:52:in `block in <class:FollowingTest>' ERROR["test_should_follow_a_user_with_Ajax", FollowingTest, 2.1544998910003414] test_should_follow_a_user_with_Ajax#FollowingTest (2.15s) ActionView::Template::Error: ActionView::Template::Error: undefined method `id' for nil:NilClass app/views/users/_unfollow.html.erb:1:in `_app_views_users__unfollow_html_erb___807541820124113879_67512860' app/views/relationships/create.js.erb:1:in `_app_views_relationships_create_js_erb__4011867530934198434_67498560' test/integration/following_test.rb:37:in `block (2 levels) in <class:FollowingTest>' test/integration/following_test.rb:36:in `block in <class:FollowingTest>' ERROR["test_should_unfollow_a_user_the_standard_way", FollowingTest, 2.1841038560000925] test_should_unfollow_a_user_the_standard_way#FollowingTest (2.18s) ActionController::UnknownFormat: ActionController::UnknownFormat: RelationshipsController#destroy is missing a template for this request format and variant. request.formats: ["text/html"] request.variant: [] test/integration/following_test.rb:45:in `block (2 levels) in <class:FollowingTest>' test/integration/following_test.rb:44:in `block in <class:FollowingTest>' ERROR["test_should_follow_a_user_the_standard_way", FollowingTest, 2.2125239619999775] test_should_follow_a_user_the_standard_way#FollowingTest (2.21s) ActionController::UnknownFormat: ActionController::UnknownFormat: RelationshipsController#create is missing a template for this request format and variant. request.formats: ["text/html"] request.variant: [] test/integration/following_test.rb:31:in `block (2 levels) in <class:FollowingTest>' test/integration/following_test.rb:30:in `block in <class:FollowingTest>' 62/62: [=======================================================================================================================================] 100% Time: 00:00:02, Time: 00:00:02 Finished in 2.54242s 62 tests, 297 assertions, 0 failures, 4 errors, 0 skips
該当のソースコード
ソースコード
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
AWS Cloud9
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/10 12:38
2019/10/10 12:53
2019/10/10 13:07