Rails 报错:ExecJS::ProgramError in Products#index,求解决方法

runup · 2015年02月10日 · 最后由 usapla 回复于 2015年08月04日 · 3830 次阅读

问题描述:在 windows 平台下面简单执行了下面的几条语句,出现:ExecJS::ProgramError in Products#index,求解决方法? 语句语句:

rails new depot
rails  g scaffold Product title:string description:text image_url:string price:decimal 
rake db:migrate

没装 nodejs

其实遇到这种问题应该先 google,发到这里大部分人都懒得回复。

3 楼 已删除

#3 楼 @cysh windows 装 nodejs 不行么

#4 楼 @beiersi 转了 nodejs,还是报这个错误

#5 楼 @runup 可能是 nodejs 没有加入到 path 中导致的,你也可以在 Gemfile 中注释掉

gem 'therubyracer', platforms: :ruby

然后执行 bundle install

gemfile 中添加:gem 'coffee-script-source', '1.8.0' 然后:bundle update coffee-script-source

#7 楼 @chulielee 没有用你的方法,过了几天试这个程序,发现可以用了

#7 楼 @chulielee 这个答案,亲测可用,阿里嘎多

需要 登录 后方可回复, 如果你还没有账号请 注册新账号