0
votes

I'm having a problem during deployment using cap deploy: the command bundle exec rake assets:precompile fails (also locally)

I'm using Rails 3.2.11

bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace

** Invoke assets:precompile:all (first_time)

** Execute assets:precompile:all

** Invoke assets:precompile:primary (first_time)

** Invoke assets:environment (first_time)

** Execute assets:environment

** Invoke environment (first_time)

** Execute environment

** Invoke tmp:cache:clear (first_time)

** Execute tmp:cache:clear

** Execute assets:precompile:primary

rake aborted!

Unexpected token: operator (<) (line: 39879, col: 0, pos: 1151635)

Error

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

(in /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'

When I change to: config.assets.compress = false I can deploy it but my Javascript doesn't work anymore. I searched everything but I don't have a glue where to search for: Unexpected token: operator (<) (line:39879 ...

I also had a look a this answer:

bundle exec rake assets:precompile fails with `unexpected token`

but I didin't help...

Here's my assets pipeline:

//= require jquery
//= require jquery.ui.all
//= require jquery_ujs
//= require bootstrap
//= require dataTables/jquery.dataTables
//= require_tree .

and for th css files:

 *= require_self
 *= require jquery.ui.all
 *= require dataTables/src/demo_table_jui
 *= require_tree .

Any help would be appreciated.

Update:

After a lot of try and error I removed jquery.cookie.js and the error disappears. Now whats left is an css error:

Invalid CSS after "...dding-left:8px}": expected selector or at-rule, was "<!DOCTYPE html>"

I'll further investigate...

Oliver

1

1 Answers

0
votes

The css error is also solved. For whatever reason I had jquery-ui.css inside my css folder. After removing the file it precompiles without error.