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

runup · February 10, 2015 · Last by usapla replied at August 04, 2015 · 3833 hits

问题描述:在 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 Floor has deleted

#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 这个答案,亲测可用,阿里嘎多

You need to Sign in before reply, if you don't have an account, please Sign up first.