【发布时间】:2015-11-02 00:06:34
【问题描述】:
我终于修复了程序中的大部分错误,但 Ruby on Rails 命令提示符一直给我同样的错误信息:
``1) Error:
StaticPagesControllerTest#test_should_get_about:
ActionView::Template::Error: TypeError: Object doesn't support this property or method
(in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks- 2.5.3/lib/assets/javascripts/turbolinks.js.coffee)
app/views/layouts/application.html.erb:7:in ` _app_views_layouts_application_html_erb__148079984_48137160'
test/controllers/static_pages_controller_test.rb:17:in `block in <class:StaticPagesControllerTest>'
2) Error:
StaticPagesControllerTest#test_should_get_contact:
ActionView::Template::Error: TypeError: Object doesn't support this property or method
(in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)
app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__148079984_48137160'
test/controllers/static_pages_controller_test.rb:23:in `block in <class:StaticPagesControllerTest>'
3) Error:
StaticPagesControllerTest#test_should_get_help:
ActionView::Template::Error: TypeError: Object doesn't support this property or method
(in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)
app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__148079984_48137160'
test/controllers/static_pages_controller_test.rb:11:in `block in <class:StaticPagesControllerTest>'
4) Error:
StaticPagesControllerTest#test_should_get_home:
ActionView::Template::Error: TypeError: Object doesn't support this property or method
(in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)
app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__148079984_48137160'
test/controllers/static_pages_controller_test.rb:5:in `block in <class:StaticPagesControllerTest>'
我该如何解决这个问题?如果不解决此问题,我将无法进入我的应用程序。
【问题讨论】:
-
您在 Windows 上吗?请出示您的
Gemfile和application.js文件。 -
我在 Windows 上,但目前我的 rails 应用程序没有 application.js 文件。 gemfile 不能在 cmets 中显示。
-
Windows 有一个已知问题(
gem 'coffee-script-source' in 1.9.0)。看到这个答案:stackoverflow.com/a/29609359/981183这也应该解决你的问题......
标签: ruby-on-rails ruby testing error-handling syntax-error