Rails:如何调试资产:在cap部署上预编译失败

时间:2013-09-19 21:27:46

标签: ruby-on-rails coffeescript capistrano asset-pipeline

我在cap deploy

上收到了一个神秘的错误
$ cap deploy
. . .
  * executing "cd -- /rails/myapp/releases/20130919002235 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile"
    servers: ["persephone"]
    [persephone] executing command
. . .
 ** [out :: persephone] rake aborted!
 ** [out :: persephone] Caught Encoding::CompatibilityError at '["ok","(function() {': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)
 ** [out :: persephone] (in /rails/myapp/releases/20130919002235/app/assets/javascripts/disk_files.js.coffee)
 ** [out :: persephone] /rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/pure/parser.rb:242:in `rescue in parse_string'
 ** [out :: persephone] /rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/pure/parser.rb:213:in `parse_string'
 ** [out :: persephone] /rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/pure/parser.rb:257:in `parse_value'
 ** [out :: persephone] /rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/pure/parser.rb:121:in `parse'
 ** [out :: persephone] /rails/myapp/shared/bundle/ruby/2.0.0/gems/json-1.8.0/lib/json/common.rb:155:in `parse'
. . .

在尝试调试问题时,我尝试完全删除disk_files.js.coffee,然后application.js出现同样的错误。

我已经更改了我的application.js清单,因此它不需要任何内容​​,然后我收到application.css的类似错误

我已经注释掉了我的自定义CSS,现在我得到了:

 ** [out :: persephone] rake aborted!
 ** [out :: persephone] undefined method `[]' for nil:NilClass
 ** [out :: persephone] (in /rails/myapp/releases/20130919200133/app/assets/stylesheets/application.css)
 ** [out :: persephone] /rails/myapp/shared/bundle/ruby/2.0.0/gems/sprockets-2.10.0/lib/sprockets/sass_functions.rb:63:in `sprockets_context'

每个步骤都要求git提交到原点,然后是cap deploy

FWIW-根据SO#9857443添加#encoding:UTF-8无济于事。

任何人都知道发生了什么事吗?我该怎么调试呢?

0 个答案:

没有答案