2016-09-16 6 views
2

railstutorial.orgでRailsチュートリアルを実行しようとしています。私は現在チュートリアルのテスト部分にいます。テストを実行するときにエラーが発生します。私が 'StaticPagesコントローラを生成する'コマンドで作成したテストファイルはそのままで、私はまったく変更していません。ここでRailsテストが正しく動作しません

/Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/abstract_controller/helpers.rb:152:in `rescue in block in modules_for_helpers': Missing helper file helpers//users/user/programming/odin/rails/sample_app/app/helpers/application_helper.rb_helper.rb (AbstractController::Helpers::MissingHelperError)

はバックトレースです:

from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/abstract_controller/helpers.rb:149:in block in modules_for_helpers' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/abstract_controller/helpers.rb:145:in map!' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/abstract_controller/helpers.rb:145:in modules_for_helpers' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/helpers.rb:93:in modules_for_helpers' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/abstract_controller/helpers.rb:109:in helper' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/action_controller/railties/helpers.rb:17:in inherited' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/test_case.rb:11:in <class:TestCase>' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/test_case.rb:10:in ' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/test_case.rb:8:in <top (required)>' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in block in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in load_dependency' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/rails-controller-testing-0.1.1/lib/rails-controller-testing.rb:16:in block in ' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:38:in instance_eval' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:38:in execute_hook' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:45:in block in run_load_hooks' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in each' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in run_load_hooks' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/base.rb:215:in ' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/base.rb:139:in <module:ActionView>' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/base.rb:10:in ' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in block in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in load_dependency' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:5:in <top (required)>' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in block in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in load_dependency' from /Users/user/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application/default_middleware_stack.rb:48:in block in build_stack' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application/default_middleware_stack.rb:13:in tap' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application/default_middleware_stack.rb:13:in build_stack' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:504:in default_middleware_stack' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:506:in block in app' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:504:in synchronize' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:504:in app' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:37:in block in <module:Finisher>' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in instance_exec' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in run' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in block in run_initializers' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:228:in block in tsort_each' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:431:in each_strongly_connected_component_from' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:349:in block in each_strongly_connected_component' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in each' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in call' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in each_strongly_connected_component' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:226:in tsort_each' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:205:in tsort_each' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in run_initializers' from /Users/user/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in initialize!' from /Users/user/Programming/Odin/rails/sample_app/config/environment.rb:5:in ' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:92:in require' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:92:in preload' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:143:in serve' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:131:in block in run' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in loop' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in run' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in <top (required)>' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Users/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in '

これがフォーマットと、imporperlyまたはものではありません、私は謝罪どんな助けを求めている場合は、私はコマンドで入力したとき、私はこのエラーを取得する「テストレール」私は絶対に困惑しました。ここ はgithubのレポです:https://github.com/JDjedi/sample_app

Railsのバージョンは5.0で、Rubyのバージョンは、2.3.0p0

答えて

0

application_helper.rb_helper.rbである - これはあなたのヘルパーと呼ばれる方法ですか? .rbは拡張です。したがって、ヘルパーファイルの名前をapplication_helper.rbに変更して、それが機能するかどうか確認できますか?

編集:

この質問を見ましたか?単純に同じ名前のルートフォルダの名前を変更https://stackoverflow.com/a/28269245/1010826

:ここRails: AbstractController::Helpers::MissingHelperError - Missing helper file application_helper.rb_helper.rb

は、作業の答えのようです。しかし、それがうまくいく理由はわかりません:)

+0

ディレクトリには、 'application_helper.rb'と書かれています。元の投稿でgithubリポジトリの拡張機能を提供します。 – JCD

+0

@JCD更新の回答 – Magnuss

+0

私の無知を許しても、私はまだ理解していません – JCD

関連する問題