我在使用cap deploy部署期间遇到问题: 命令包exec rake assets:预编译失败(也是本地)
我正在使用Rails 3.2.11
bin / rake assets:precompile:all RAILS_ENV = production RAILS_GROUPS = assets --trace
**调用资产:预编译:all(first_time)
**执行资产:预编译:全部
**调用资产:预编译:primary(first_time)
**调用资产:环境(first_time)
**执行资产:环境
**调用环境(first_time)
**执行环境
**调用tmp:cache:clear(first_time)
**执行tmp:cache:clear
**执行资产:预编译:主要
rake aborted!
意外的令牌:运算符(<)(第39879行,第0栏,第55位):
错误
at new JS_Parse_Error (/tmp/execjs20130902-31115-1frab1p.js:2357:10736)
at js_error (/tmp/execjs20130902-31115-1frab1p.js:2357:10955)
at croak (/tmp/execjs20130902-31115-1frab1p.js:2357:18667)
at token_error (/tmp/execjs20130902-31115-1frab1p.js:2357:18804)
at unexpected (/tmp/execjs20130902-31115-1frab1p.js:2357:18892)
at expr_atom (/tmp/execjs20130902-31115-1frab1p.js:2357:26838)
at maybe_unary (/tmp/execjs20130902-31115-1frab1p.js:2357:29262)
at expr_ops (/tmp/execjs20130902-31115-1frab1p.js:2357:30020)
at maybe_conditional (/tmp/execjs20130902-31115-1frab1p.js:2357:30112)
at maybe_assign (/tmp/execjs20130902-31115-1frab1p.js:2357:30555)
at expression (/tmp/execjs20130902-31115-1frab1p.js:2357:30868)
at simple_statement (/tmp/execjs20130902-31115-1frab1p.js:2357:21834)
at /tmp/execjs20130902-31115-1frab1p.js:2357:20007
at /tmp/execjs20130902-31115-1frab1p.js:2357:19538
(在 /home/ohunewald/rails_projects/bigAl/app/assets/javascripts/application.js)/home/ohunewald/.rvm/gems/ruby-1.9.3-p194@TestRails/gems/execjs-2.0.1/lib/execjs /external_runtime.rb:68:in“extract_result”
当我改为:config.assets.compress = false时 我可以部署它但我的Javascript不再工作了。 我搜索了一切,但我没有胶水在哪里搜索: 意外的令牌:运算符(<)(行:39879 ......
我也看了一下这个答案:
bundle exec rake assets:precompile fails with `unexpected token`
但我没有帮助......
这是我的资产管道:
//= require jquery
//= require jquery.ui.all
//= require jquery_ujs
//= require bootstrap
//= require dataTables/jquery.dataTables
//= require_tree .
和css文件:
*= require_self
*= require jquery.ui.all
*= require dataTables/src/demo_table_jui
*= require_tree .
任何帮助都将不胜感激。
更新
经过大量尝试和错误后,我删除了jquery.cookie.js,错误消失了。 现在剩下的是一个css错误:
Invalid CSS after "...dding-left:8px}": expected selector or at-rule, was "<!DOCTYPE html>"
我会进一步调查......
奥利弗
答案 0 :(得分:0)
css错误也解决了。无论出于何种原因,我在我的css文件夹中都有jquery-ui.css。 删除文件后,它会预编译而不会出错。