1

首先,我还在忙于学习 RoR,所以我的理解有限。我创建了一个新的简单项目并生成了我的第一个名为“Person”的脚手架。当我启动我的 WEBrick 服务器时,我去 localhost:3000/people 我得到以下运行时错误:

People#index 中的 ExecJS::RuntimeError 显示 C:/Users/Dean/Desktop/guestbook/app/views/layouts/application.html.erb 其中第 6 行提出:(在 C:/Users/Dean/Desktop/guestbook/ app/assets/javascripts/ people.js.coffee)提取的源代码(在第 6 行附近):

3: <head>
4:   <title>Guestbook</title>
5:   <%= stylesheet_link_tag    "application", :media => "all" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= csrf_meta_tags %>
8: </head>
9: <body>

如果需要更多说明,请告诉我,我很乐意更新我的问题。我不是专家,但看起来这与..咖啡脚本宝石有关?我真的只是在这里吐痰......提前谢谢!

people.js.coffee:

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
4

1 回答 1

3

ExecJS::RuntimeErrors 通常是由咖啡脚本中的语法错误引起的。检查第 6 行的 people.js.coffee 文件并确保其语法正确。如果您对coffeescript 比较陌生,http://js2coffee.org/JS 和 coffee 之间进行转换,可能会有所帮助。.js.coffee 文件将只接受 coffeescript。

于 2013-10-02T05:56:48.693 回答