Uglifier ::错误:无效的regexp字符在heroku中启动Rails应用程序时出错

时间:2018-05-14 10:11:12

标签: ruby-on-rails heroku

我正在尝试在heroku中启动我的rails应用程序但是我遇到了一些错误 这个日志

我可以在我的Windows机器上成功启动此应用程序,但只有Heroku才能解决问题

D:\Ruby\Assignment2>git push heroku master
    Counting objects: 390, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (369/369), done.
    Writing objects: 100% (390/390), 136.69 KiB | 748.00 KiB/s, done.
    Total 390 (delta 174), reused 0 (delta 0)
    remote: Compressing source files... done.
    remote: Building source:
    remote:
    remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
    remote:                         Detected buildpacks: Ruby,Node.js
    remote:                         See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
    remote: -----> Ruby app detected
    remote: -----> Compiling Ruby/Rails
    remote: -----> Using Ruby version: ruby-2.4.4
    remote: ###### WARNING:
    remote:        Removing `Gemfile.lock` because it was generated on Windows.
    remote:        Bundler will do a full resolve so native gems are handled properly.
    remote:        This may result in unexpected gem versions being used in your app.
    remote:        In rare occasions Bundler may not be able to resolve your dependencies at all.
    remote:        https://devcenter.heroku.com/articles/bundler-windows-gemfile
    remote:
    remote: -----> Installing dependencies using bundler 1.15.2
    remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
    remote:        Fetching https://github.com/codahale/bcrypt-ruby.git
    remote:        The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32,
     java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
    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:        Resolving dependencies...
    remote:        Fetching rake 12.3.1
    remote:        Fetching concurrent-ruby 1.0.5
    remote:        Fetching minitest 5.11.3
    remote:        Installing minitest 5.11.3
    remote:        Installing rake 12.3.1
    remote:        Installing concurrent-ruby 1.0.5
    remote:        Fetching thread_safe 0.3.6
    remote:        Installing thread_safe 0.3.6
    remote:        Fetching builder 3.2.3
    remote:        Installing builder 3.2.3
    remote:        Fetching erubi 1.7.1
    remote:        Installing erubi 1.7.1
    remote:        Fetching mini_portile2 2.3.0
    remote:        Fetching crass 1.0.4
    remote:        Installing mini_portile2 2.3.0
    remote:        Fetching rack 2.0.5
    remote:        Installing crass 1.0.4
    remote:        Fetching nio4r 2.3.1
    remote:        Installing rack 2.0.5
    remote:        Installing nio4r 2.3.1 with native extensions
    remote:        Fetching websocket-extensions 0.1.3
    remote:        Installing websocket-extensions 0.1.3
    remote:        Fetching mini_mime 1.0.0
    remote:        Installing mini_mime 1.0.0
    remote:        Fetching arel 9.0.0
    remote:        Installing arel 9.0.0
    remote:        Fetching mimemagic 0.3.2
    remote:        Using bcrypt 3.1.11 from https://github.com/codahale/bcrypt-ruby.git (at master@5c2d2d3)
    remote:        Installing mimemagic 0.3.2
    remote:        Fetching msgpack 1.2.4
    remote:        Installing msgpack 1.2.4 with native extensions
    remote:        Using bundler 1.15.2
    remote:        Fetching coffee-script-source 1.12.2
    remote:        Installing coffee-script-source 1.12.2
    remote:        Fetching execjs 2.7.0
    remote:        Installing execjs 2.7.0
    remote:        Fetching method_source 0.9.0
    remote:        Installing method_source 0.9.0
    remote:        Fetching thor 0.20.0
    remote:        Installing thor 0.20.0
    remote:        Fetching duktape 1.6.1.0
    remote:        Installing duktape 1.6.1.0 with native extensions
    remote:        Fetching ffi 1.9.23
    remote:        Installing ffi 1.9.23 with native extensions
    remote:        Fetching multi_json 1.13.1
    remote:        Installing multi_json 1.13.1
    remote:        Fetching pg 1.0.0
    remote:        Installing pg 1.0.0 with native extensions
    remote:        Fetching puma 3.11.4
    remote:        Installing puma 3.11.4 with native extensions
    remote:        Fetching rb-fsevent 0.10.3
    remote:        Installing rb-fsevent 0.10.3
    remote:        Fetching tilt 2.0.8
    remote:        Installing tilt 2.0.8
    remote:        Fetching turbolinks-source 5.1.0
    remote:        Installing turbolinks-source 5.1.0
    remote:        Fetching tzinfo 1.2.5
    remote:        Installing tzinfo 1.2.5
    remote:        Fetching i18n 1.0.1
    remote:        Installing i18n 1.0.1
    remote:        Fetching nokogiri 1.8.2
    remote:        Installing nokogiri 1.8.2 with native extensions
    remote:        Fetching websocket-driver 0.7.0
    remote:        Installing websocket-driver 0.7.0 with native extensions
    remote:        Fetching mail 2.7.0
    remote:        Installing mail 2.7.0
    remote:        Fetching rack-test 1.0.0
    remote:        Installing rack-test 1.0.0
    remote:        Fetching sprockets 3.7.1
    remote:        Installing sprockets 3.7.1
    remote:        Fetching marcel 0.3.2
    remote:        Installing marcel 0.3.2
    remote:        Fetching coffee-script 2.4.1
    remote:        Installing coffee-script 2.4.1
    remote:        Fetching uglifier 4.1.10
    remote:        Installing uglifier 4.1.10
    remote:        Fetching bootsnap 1.3.0
    remote:        Installing bootsnap 1.3.0 with native extensions
    remote:        Fetching rb-inotify 0.9.10
    remote:        Installing rb-inotify 0.9.10
    remote:        Fetching turbolinks 5.1.1
    remote:        Installing turbolinks 5.1.1
    remote:        Fetching activesupport 5.2.0
    remote:        Installing activesupport 5.2.0
    remote:        Fetching loofah 2.2.2
    remote:        Installing loofah 2.2.2
    remote:        Fetching sass-listen 4.0.0
    remote:        Fetching rails-dom-testing 2.0.3
    remote:        Installing rails-dom-testing 2.0.3
    remote:        Installing sass-listen 4.0.0
    remote:        Fetching globalid 0.4.1
    remote:        Installing globalid 0.4.1
    remote:        Fetching activemodel 5.2.0
    remote:        Fetching jbuilder 2.7.0
    remote:        Installing activemodel 5.2.0
    remote:        Installing jbuilder 2.7.0
    remote:        Fetching rails-html-sanitizer 1.0.4
    remote:        Installing rails-html-sanitizer 1.0.4
    remote:        Fetching sass 3.5.6
    remote:        Fetching activejob 5.2.0
    remote:        Installing activejob 5.2.0
    remote:        Fetching activerecord 5.2.0
    remote:        Installing sass 3.5.6
    remote:        Fetching actionview 5.2.0
    remote:        Installing activerecord 5.2.0
    remote:        Installing actionview 5.2.0
    remote:        Fetching actionpack 5.2.0
    remote:        Installing actionpack 5.2.0
    remote:        Fetching actioncable 5.2.0
    remote:        Fetching actionmailer 5.2.0
    remote:        Fetching activestorage 5.2.0
    remote:        Installing actionmailer 5.2.0
    remote:        Installing activestorage 5.2.0
    remote:        Installing actioncable 5.2.0
    remote:        Fetching railties 5.2.0
    remote:        Fetching sprockets-rails 3.2.1
    remote:        Installing railties 5.2.0
    remote:        Installing sprockets-rails 3.2.1
    remote:        Fetching jquery-rails 4.3.3
    remote:        Fetching rails 5.2.0
    remote:        Fetching coffee-rails 4.2.2
    remote:        Installing rails 5.2.0
    remote:        Installing coffee-rails 4.2.2
    remote:        Fetching sass-rails 5.0.7
    remote:        Installing sass-rails 5.0.7
    remote:        Installing jquery-rails 4.3.3
    remote:        Bundle complete! 20 Gemfile dependencies, 64 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 (46.58s)
    remote:        Cleaning up the bundler cache.
    remote:        The latest bundler is 1.16.1, but you are currently running 1.15.2.
    remote:        To update, run `gem install bundler`
    remote: -----> Installing node-v8.10.0-linux-x64
    remote: -----> Detecting rake tasks
    remote: -----> Preparing app for Rails asset pipeline
    remote:        Running: rake assets:precompile
    remote:        Yarn executable was not detected in the system.
    remote:        Download Yarn at https://yarnpkg.com/en/docs/install
    remote:        I, [2018-05-14T09:58:09.678891 #1526]  INFO -- : Writing /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/public/assets/bootstrap/bootstrap.min-41d69a549b928e8604da63024bd4c6fdc296140a12d98fc0598ebf25417ec
    dc7.js
    remote:        I, [2018-05-14T09:58:09.679477 #1526]  INFO -- : Writing /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/public/assets/bootstrap/bootstrap.min-41d69a549b928e8604da63024bd4c6fdc296140a12d98fc0598ebf25417ec
    dc7.js.gz
    remote:        I, [2018-05-14T09:58:14.425693 #1526]  INFO -- : Writing /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/public/assets/bootstrap/popper.min-a825c07c7e993c902b4523b21ac31ee3818600cc5c82538e61f5401fd516b8a0
    .js
    remote:        I, [2018-05-14T09:58:14.425883 #1526]  INFO -- : Writing /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/public/assets/bootstrap/popper.min-a825c07c7e993c902b4523b21ac31ee3818600cc5c82538e61f5401fd516b8a0
    .js.gz
    remote:        I, [2018-05-14T09:59:23.617617 #1526]  INFO -- : Writing /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/public/assets/bootstrap/mdb.min-628e2e9674c6df4e4bcd41fa2b7b88aa070a227955b83bb6da8fc8118fb4e9e5.js

    remote:        I, [2018-05-14T09:59:23.617808 #1526]  INFO -- : Writing /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/public/assets/bootstrap/mdb.min-628e2e9674c6df4e4bcd41fa2b7b88aa070a227955b83bb6da8fc8118fb4e9e5.js
    .gz
    remote:        rake aborted!
    remote:        Uglifier::Error: invalid regexp character
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/uglifier-4.1.10/lib/uglifier.rb:234:in `parse_result'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/uglifier-4.1.10/lib/uglifier.rb:216:in `run_uglifyjs'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/uglifier-4.1.10/lib/uglifier.rb:168:in `compile'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:in `call'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in `call'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in `block in find'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `each'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `block in logical_paths'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `each'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `logical_paths'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in `find'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
    remote:        /tmp/build_c6b86f16f166c2e8a833fb45a48cab86/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/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 fathomless-falls-15474.
    remote:
    To https://git.heroku.com/fathomless-falls-15474.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/fathomless-falls-15474.git'

当我在我的机器中运行rake assets:precompile时,我没有收到任何错误,但当我尝试将其推送到heroku时,它会引发一些错误,如何解决它

这是我的回购https://nijeeshjoshy@bitbucket.org/nijeeshjoshy/assignment2.git

1 个答案:

答案 0 :(得分:0)

显然你遇到的是你有一个带有拼写错误的js文件,当uglifier试图压缩它破坏的文件时,看看这个答案,我认为它会为你服务

Rails 3.1 Possible Bug in Asset Pipeline and Uglifier