我正在通过Michael Hartl的Ruby on Rails教程开展工作,所有步骤均按预期工作,直到2.2.1节的开始。Michael Hartl的Ruby on Rails教程,toy_app用户浏览
第一句话说,访问根将显示默认的Rails页面。但它不;它显示了“hello world”,因为2.1节中的教程让我们在部署到Heroku之前将root#定义为application#hello。如果我去http://localhost:3000/users/,我得到一个错误:
ExecJS::ProgramError in Users#index
Showing C:/Users/dfretz/dfretz/Coursera/Rails_tutorial/toy_app/app/views/layouts/application.html.erb where line #6 raised:
TypeError: Object doesn't support this property or method
由于这是脚手架生成的代码,我不知道如何解决这个问题,或者你需要看到即使什么文件,以帮助。
有人可以告诉我我做错了什么吗?
它是一个Windows的问题,请参见本QA的http://计算器。 (用户#索引(RoR)]中的[ExecJS :: RuntimeError]的可能重复(http://support.microsoft.com/kb/28312460/对象不支持此属性或方法的rails-windows-64bit – Tachyons
/questions/13530042/execjsruntimeerror-in-usersindex-ror) – illusionist
谢谢,它现在正在工作。解决方案在@Tachyons提供的链接中。在\ app \ views \ layouts \ application.html.erb文件中,将第6行从 <%= javascript_include_tag'application','data-turbolinks-track'=> true%>更改为<%= javascript_include_tag'**默认值**','data-turbolinks-track'=> true%>修复它。为了记录,我正在Windows 7上运行。谢谢! –