Users#index(RoR)中的ExecJS :: RuntimeError

只需运行一个“生成脚手架用户...”命令。


然后我去localhost:3000/users/看看:


 ExecJS::RuntimeError in Users#index


Showing C:/Users/TheOnlyUser/Desktop/NMS/nms2/app/views/layouts/application.html.erb where line #6 raised:



  (in C:/Users/TheOnlyUser/Desktop/NMS/nms2/app/assets/javascripts/ads.js.coffee)


Extracted source (around line #6):


3: <head>

4:   <title>Nms2</title>

5:   <%= stylesheet_link_tag    "application", :media => "all" %>

6:   <%= javascript_include_tag "application" %>

7:   <%= csrf_meta_tags %>

8: </head>

9: <body>


Rails.root: C:/Users/TheOnlyUser/Desktop/NMS/nms2

Application Trace | Framework Trace | Full Trace


app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___753556572_43068540'

app/controllers/users_controller.rb:7:in `index'

...

这到底是什么意思?


更新:


在Windows 8上。Windows 7不会出现这些错误。


万千封印
浏览 509回答 3
3回答

慕尼黑的夜晚无繁华

就像评论者说的那样,您可能缺少一颗宝石。尝试将以下内容添加到您的gemfile中:gem 'therubyracer'然后跑 bundle install

梵蒂冈之花

我最初是由Kevin P寻求上述解决方案3的,并且在Windows 8计算机上一切正常。昨晚(13/8/19)更新MS之后,我什至无法在Rails应用程序中呈现主页。我安装了node.js,它可以正常工作,所以现在使用解决方案2。
打开App,查看更多内容
随时随地看视频慕课网APP