预编译资产失败。在heroku

时间:2017-10-18 11:16:00

标签: javascript ruby-on-rails ruby heroku deployment

在部署到heroku时遇到此错误。这是我第一次部署,所以任何帮助都是适用的。

remote:        rake aborted!
remote:        ExecJS::RuntimeError: SyntaxError: Unexpected character '#'
remote:        JS_Parse_Error.Object.defineProperty.get ((execjs):3538:621)
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:47:in `rescue in block in call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:44:in `block in call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:75:in `block in lock'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:73:in `Locker'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:73:in `lock'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:43:in `call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/uglifier-3.1.9/lib/uglifier.rb:190:in `run_uglifyjs'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/uglifier-3.1.9/lib/uglifier.rb:152:in `compile'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:in `call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in `call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:134:in `block in find'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:133:in `each'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:133:in `find'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
remote:        V8::Error: Unexpected character '#'
remote:        at js_error (<eval>:3623:12181)
remote:        at parse_error (<eval>:3623:14198)
remote:        at next_token (<eval>:3623:19758)
remote:        at next (<eval>:3623:21695)
remote:        at <eval>:3623:23768
remote:        at <eval>:3623:22771
remote:        at <eval>:3624:3495
remote:        at parse (<eval>:3624:3735)
remote:        at parse (<eval>:3959:22)
remote:        at uglifier (<eval>:4007:13)
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:45:in `block in call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:75:in `block in lock'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:73:in `Locker'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:73:in `lock'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:43:in `call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/uglifier-3.1.9/lib/uglifier.rb:190:in `run_uglifyjs'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/uglifier-3.1.9/lib/uglifier.rb:152:in `compile'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:in `call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in `call'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:134:in `block in find'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:133:in `each'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:133:in `find'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:        /tmp/build_0cc559ca757e781035a2d51391cb0258/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to laundryapp-aaquib.
remote: 
To https://git.heroku.com/laundryapp-aaquib.git
 ! [remote rejected] master -> master (pre-receive hook declined)

我删除了由scaffold创建的所有cofee脚本文件,并将其替换为“.js”扩展名,并删除了我不需要的内容。我还将application.css替换为application.css.scss.I也尝试过 rake资产:预编译RAILS_ENV =开发和生产相同,但是得到了与上面相同的错误。我也推荐到heroku  重要提示:您可能需要向Gemfile添加一个javascript运行时,以便将bootstrap的LESS文件编译为CSS。

0 个答案:

没有答案