1

Same error, different problem...
it 's my first deployment, working with a tuto (pragmatic studio). The app works fine locally.

But when I deployed my app to Heroku. I am having this error in the log :

-----> Preparing app for Rails asset pipeline
          Running: rake assets:precompile
          rake aborted!
          ExecJS::ProgramError: Unexpected token: eof (undefined) (line: 10754, col: 0, pos: 299145)
          Error
          at new JS_Parse_Error (/tmp/execjs20140613-1094-180xlm9js:2357:10754)
          at js_error (/tmp/execjs20140613-1094-180xlm9js:2357:10973)
          at croak (/tmp/execjs20140613-1094-180xlm9js:2357:19198)
          at token_error (/tmp/execjs20140613-1094-180xlm9js:2357:19335)
          at unexpected (/tmp/execjs20140613-1094-180xlm9js:2357:19423)
          at as_name (/tmp/execjs20140613-1094-180xlm9js:2357:29065)
          at /tmp/execjs20140613-1094-180xlm9js:2357:29514
          at /tmp/execjs20140613-1094-180xlm9js:2357:27576
          at /tmp/execjs20140613-1094-180xlm9js:2357:30108
          at expr_ops (/tmp/execjs20140613-1094-180xlm9js:2357:30866)
          (in /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/app/assets/javascripts/application.js)/tmp/build_87be0d5e-25c
   3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/execjs-2.2.0/lib/execjs/external_runtime.rb:64:in `extract_result
   '
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/execjs-2.2.0/lib/execjs/external_ru
   ntime.rb:29:in `exec'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/uglifier-2.5.0/lib/uglifier.rb:186:
   in `really_compile'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/uglifier-2.5.0/lib/uglifier.rb:110:
   in `compile'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/ugli
   fier_compressor.rb:25:in `evaluate'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103
   :in `render'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/cont
   ext.rb:197:in `block in evaluate'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/cont
   ext.rb:194:in `each'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/cont
   ext.rb:194:in `evaluate'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/bund
   led_asset.rb:25:in `initialize'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/base
   .rb:377:in `new'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/base
   .rb:377:in `build_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/inde
   x.rb:94:in `block in build_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/cach
   ing.rb:58:in `cache_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/inde
   x.rb:93:in `build_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/base
   .rb:287:in `find_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/inde
   x.rb:61:in `find_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/mani
   fest.rb:211:in `block in find_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/mani
   fest.rb:257:in `benchmark'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/mani
   fest.rb:210:in `find_asset'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/mani
   fest.rb:119:in `block in compile'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/mani
   fest.rb:118:in `each'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/sprockets/mani
   fest.rb:118:in `compile'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-rails-2.0.1/lib/sprockets
   /rails/task.rb:60:in `block (3 levels) in define'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-2.11.0/lib/rake/sprockets
   task.rb:146:in `with_logger'
          /tmp/build_87be0d5e-25c3-4e93-8bf1-c6428f2f8032/vendor/bundle/ruby/1.9.1/gems/sprockets-rails-2.0.1/lib/sprockets
   /rails/task.rb:59:in `block (2 levels) in define'
          Tasks: TOP => assets:precompile
          (See full trace by running task with --trace)
    !
    !     Precompiling assets failed.
    !

    !     Push rejected, failed to compile Ruby app

My application.js looks like :

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .

My production.rb looks like :

config.serve_static_assets = true

config.assets.js_compressor = :uglifier

config.assets.compile = true

config.assets.digest = true

My database.yml :

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

And I have only 3 files in my folder app/assets/js - application.js (see above) - events.js.coffee (only comments) - Registrations.js.coffee (only comments)

I feel like failing my first night of sex :(
Any idea?

Community
  • 1
  • 1
xavier carbonel
  • 339
  • 1
  • 3
  • 8
  • remove the empty files (those with only comments) – Mike Szyndel Jun 13 '14 at 10:30
  • Done. Same error... (actually I edited my post, both files were .js.coffee files) My apologize for the lack of precision – xavier carbonel Jun 13 '14 at 10:47
  • what happens if you run `RAILS_ENV=production bundle exec rake assets:precompile`? on local machine – Mike Szyndel Jun 13 '14 at 15:21
  • 2
    Also I bet if you open developer console in your browser you will see there's syntax error in your JS. – Mike Szyndel Jun 13 '14 at 15:27
  • Thanks Michal, problem solved. Actually I had to change the application.js code to make rails work on windows 8...that generated a js.error as you suggested. [http://stackoverflow.com/questions/13530042/execjsruntimeerror-in-usersindex-ror] – xavier carbonel Jun 14 '14 at 11:49

0 Answers0