无法在heroku中推送我的rails应用程序

时间:2017-02-09 09:43:17

标签: ruby-on-rails git heroku

我已成功将我的rails应用程序推入git,但我无法进入heroku 我收到了这个错误:

   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'

这些是我得到的错误,我不知道是否在我的图片中。以前,我将我的图像保存在我的封面文件夹中,然后将我的封面文件夹重命名为封面,仍然没有进入heroku push

2 个答案:

答案 0 :(得分:0)

尝试

RAILS_ENV=production rake assets:precompile

并推送到heroku。

在本地生产环境中检查您的应用。

答案 1 :(得分:0)

Git不会检查你推的是什么,但是Heroku的确如此。您的资产似乎有错误。通常这是CSS文件中的错误。检查错误在哪一行并更正。然后再次推送到git,然后再次尝试推送到Heroku。当您的应用程序编码正确时,推送到Heroku应该没有问题。检查您的资产或在此处发布完整的错误日志,以便我们可以查看资产中的错误位置。

在您的情况下,这是一个JS文件的问题。

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

根据Heroku的输出,您应该能够找出问题所在。或者只是试着没有那个javascript文件。这至少可以保证成功推送,您可以稍后编辑JS文件。

提示:在

之后检查Heroku日志
rake aborted!

编辑:下载版本中的标准bootstrap javascript文件应该可以正常工作。可能是你编辑过的东西?它非常规,但您可以为部署目的删除.js文件扩展名。例如.js__ 并且Heroku不会将其视为JS文件。问题解决了。无需删除文件夹中的所有文件。 如果你不喜欢这个解决方案,你应该拿出来 // require * tree 来自你的application.js 或从rails应用程序中取出所有不正确的JS文件。

javascript文件夹可以保留。问题是Javascript文件中的错误JAVASCRIPT。请找到错误的文件,并禁止它如上所述进行预编译。如果您只有bootstrap.js文件而不是更改文件扩展名或从应用程序中删除它。部署错误应该像这样解决。