简体   繁体   中英

Cannot push my rails app in heroku

I have successfully pushed my rails app into git, but I cannot push into heroku I got this error :

   Counting objects: 186, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (165/165), done.
Writing objects: 100% (186/186), 2.65 MiB | 186.00 KiB/s, done.
Total 186 (delta 35), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.6
remote: -----> Installing dependencies using bundler 1.13.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Installing rake 12.0.0
remote:        Installing i18n 0.8.0
remote:        Installing concurrent-ruby 1.0.4
remote:        Installing minitest 5.10.1
remote:        Installing thread_safe 0.3.5
remote:        Installing builder 3.2.3
remote:        Installing mini_portile2 2.1.0
remote:        Installing erubis 2.7.0
remote:        Installing nio4r 1.2.1 with native extensions
remote:        Installing rack 2.0.1
remote:        Installing websocket-extensions 0.1.2
remote:        Installing mime-types-data 3.2016.0521
remote:        Installing arel 7.1.4
remote:        Installing coffee-script-source 1.12.2
remote:        Installing execjs 2.7.0
remote:        Installing method_source 0.8.2
remote:        Installing thor 0.19.4
remote:        Installing multi_json 1.12.1
remote:        Installing puma 3.7.0 with native extensions
remote:        Installing pg 0.19.0 with native extensions
remote:        Using bundler 1.13.7
remote:        Installing rails_serve_static_assets 0.0.5
remote:        Installing rails_stdout_logging 0.0.5
remote:        Installing sass 3.4.23
remote:        Installing tilt 2.0.6
remote:        Installing turbolinks-source 5.0.0
remote:        Installing tzinfo 1.2.2
remote:        Installing nokogiri 1.7.0.1 with native extensions
remote:        Installing rack-test 0.6.3
remote:        Installing sprockets 3.7.1
remote:        Installing websocket-driver 0.6.5 with native extensions
remote:        Installing mime-types 3.1
remote:        Installing coffee-script 2.4.1
remote:        Installing uglifier 3.0.4
remote:        Installing rails_12factor 0.0.3
remote:        Installing turbolinks 5.0.1
remote:        Installing activesupport 5.0.1
remote:        Installing mail 2.6.4
remote:        Installing globalid 0.3.7
remote:        Installing activemodel 5.0.1
remote:        Installing jbuilder 2.6.1
remote:        Installing activejob 5.0.1
remote:        Installing activerecord 5.0.1
remote:        Installing rails-dom-testing 2.0.2
remote:        Installing loofah 2.0.3
remote:        Installing rails-html-sanitizer 1.0.3
remote:        Installing actionview 5.0.1
remote:        Installing actionpack 5.0.1
remote:        Installing actioncable 5.0.1
remote:        Installing actionmailer 5.0.1
remote:        Installing railties 5.0.1
remote:        Installing sprockets-rails 3.2.0
remote:        Installing coffee-rails 4.2.1
remote:        Installing rails 5.0.1
remote:        Installing sass-rails 5.0.6
remote:        Installing jquery-rails 4.2.2
remote:        Bundle complete! 17 Gemfile dependencies, 56 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (41.72s)
remote:        Cleaning up the bundler cache.
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        I, [2017-02-09T10:46:09.853640 #1155]  INFO -- : Writing /tmp/build_9491bde9458fa002c263b1f32da09990/public/assets/covers/fh1-0718ff99413a1363bf266be84142213d583f36df646c9e0e0e0f3d68cfd641b1.jpg
remote:        I, [2017-02-09T10:46:09.860022 #1155]  INFO -- : Writing /tmp/build_9491bde9458fa002c263b1f32da09990/public/assets/covers/lord-bbd09b25b741d9092434372a785198081a3cad4e1315303c077039ffe7715235.jpg
remote:        I, [2017-02-09T10:46:09.862885 #1155]  INFO -- : Writing /tmp/build_9491bde9458fa002c263b1f32da09990/public/assets/covers/me-99ceb4ad11d4c02bb6048b7eb5adb3b29544f1f3c3cfee834aad7fef29cdd12d.jpg
remote:        I, [2017-02-09T10:46:09.871125 #1155]  INFO -- : Writing /tmp/build_9491bde9458fa002c263b1f32da09990/public/assets/covers/res1-7c2aac6545629f058bbfba85ac0c04ec3d7a4db211f3c79c17d1575a8c2c9444.jpg
remote:        I, [2017-02-09T10:46:09.875159 #1155]  INFO -- : Writing /tmp/build_9491bde9458fa002c263b1f32da09990/public/assets/covers/sn1-02e69724672b9e092aa3c63b11079aff1983c1672ecc122a8bef7b0916655225.jpg
remote:        I, [2017-02-09T10:46:09.878795 #1155]  INFO -- : Writing /tmp/build_9491bde9458fa002c263b1f32da09990/public/assets/covers/tek1-55d5520379c80ae7ddbb2e237ee929a0acba2a1c988b546251e33e262bd0121b.jpg
remote:        I, [2017-02-09T10:46:09.883309 #1155]  INFO -- : Writing /tmp/build_9491bde9458fa002c263b1f32da09990/public/assets/covers/un1-7453457098bf8778d10a9e679b33d8da748af50d6372c0d1db59db8f33326fed.jpg
remote:        rake aborted!
remote:        ExecJS::RuntimeError: SyntaxError: Unexpected token: operator (<) (line: 14589, col: 0, pos: 440984)
remote:        Error
remote:        at new JS_Parse_Error (/tmp/execjs20170209-1155-meyenpjs:3623:11948)
remote:        at js_error (/tmp/execjs20170209-1155-meyenpjs:3623:12167)
remote:        at croak (/tmp/execjs20170209-1155-meyenpjs:3623:22038)
remote:        at token_error (/tmp/execjs20170209-1155-meyenpjs:3623:22175)
remote:        at unexpected (/tmp/execjs20170209-1155-meyenpjs:3623:22263)
remote:        at expr_atom (/tmp/execjs20170209-1155-meyenpjs:3623:31244)
remote:        at maybe_unary (/tmp/execjs20170209-1155-meyenpjs:3624:1752)
remote:        at expr_ops (/tmp/execjs20170209-1155-meyenpjs:3624:2523)
remote:        at maybe_conditional (/tmp/execjs20170209-1155-meyenpjs:3624:2615)
remote:        at maybe_assign (/tmp/execjs20170209-1155-meyenpjs:3624:3058)
remote:        at expression (/tmp/execjs20170209-1155-meyenpjs:3624:3384)
remote:        at simple_statement (/tmp/execjs20170209-1155-meyenpjs:3623:25942)
remote:        at /tmp/execjs20170209-1155-meyenpjs:3623:23662
remote:        at /tmp/execjs20170209-1155-meyenpjs:3623:22954
remote:        at /tmp/execjs20170209-1155-meyenpjs:3624:3759
remote:        new JS_Parse_Error ((execjs):3623:11948)
remote:        js_error ((execjs):3623:12167)
remote:        croak ((execjs):3623:22038)
remote:        token_error ((execjs):3623:22175)
remote:        unexpected ((execjs):3623:22263)
remote:        expr_atom ((execjs):3623:31244)
remote:        maybe_unary ((execjs):3624:1752)
remote:        expr_ops ((execjs):3624:2523)
remote:        maybe_conditional ((execjs):3624:2615)
remote:        maybe_assign ((execjs):3624:3058)
remote:        expression ((execjs):3624:3384)
remote:        simple_statement ((execjs):3623:25942)
remote:        (execjs):3623:23662
remote:        (execjs):3623:22954
remote:        (execjs):3624:3759
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in `exec'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:in `eval'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:46:in `call'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/uglifier-3.0.4/lib/uglifier.rb:184:in `run_uglifyjs'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/uglifier-3.0.4/lib/uglifier.rb:146:in `compile'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:in `call'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in `call'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `yield'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in `block in find'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in `block in stat_tree
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `each'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `block in logical_paths
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `each'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `logical_paths'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in `find'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:        /tmp/build_9491bde9458fa002c263b1f32da09990/vendor/bundle/ruby/2.2.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 mvgames.
remote: 
To https://git.heroku.com/mvgames.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/mvgames.git'

These are the errors I got, I do not know is it in my images. Before, I saved my images inside my cover folder, then I rename my cover folder to covers, still not working into heroku push

Try

RAILS_ENV=production rake assets:precompile

and push to heroku.

Check your app in production env locally.

Git does not check what you push but Heroku does. There seems to be an error in you assets. Usually it is a mistake in the CSS files. Check on which line the error is and correct it. Than push again to git and than try again to push to Heroku. When your app is coded correctly there should be no problem with pushing to Heroku. Check your assets or post the full error log here so we can see where the error is in your assets.

In your case it is a problem with a JS file.

ExecJS::RuntimeError: SyntaxError: Unexpected token: operator (<) (line: 14589, col: 0, pos: 440984)
at new JS_Parse_Error

following the output from Heroku you should be able to figure out where the problem is. OR just try to push without that javascript file. This will at least guarantee a successful push and you can edit the JS file later.

TIP: check the Heroku logs after

rake aborted!

EDIT: The standard bootstrap javascript file in downloaded version should work. May be you edited something? It's unconventional but you can for deploying purposes just delete the .js file extension. For example .js__ and Heroku will not treat it as a JS file. Problem solved. No need to delete all files from the folder. If you do not like that solution you should take out the // require *tree from your application.js or take out all uncorrect JS files from your rails app.

The javascript folder can stay. The problem is the wrong JAVASCRIPT in the Javascript Files. Please find the wrong file and prohibit it from being precompiled as mentioned above. If you only have bootstrap.js file than change the file extension or delete it from your app. The error for deployment should be solved like that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM