0

在 ruby​​ 1.9.3 + rails 3.2.8

a.js.咖啡

//= require b_js_file

然后bundle exec rake assets:precompile工作!

但是 ruby​​ 2.0.0 + rails 3.2.8

bundle exec rake assets:precompile生成:

rake aborted!
SyntaxError: unexpected =
  (in /home/me/tmp_code/boot/app/assets/javascripts/a.js.coffee)
/home/me/.rvm/gems/ruby-2.0.0-p195/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:47:in `rescue in block in call'
 ...

当我将它改回 ruby​​-1.9.3 时,它起作用了!

为什么???

谢谢!

4

1 回答 1

0

你确定你的陈述之前没有空行吗?rails 希望您的声明是这样的:

//= require file
//= require file
//= require file
//= require file
//= require file

这不起作用:

//= require file
//= require file
//= require file
//
//= require file

这也行不通

//= require file
//= require file
//= require file

//= require file
于 2013-07-01T14:35:17.250 回答