Я новичок в Heroku, и у меня возникают проблемы с развертыванием обновленной версии моего приложения Rails 5 из-за ошибки, связанной с Uglifier.
У меня есть версия моего приложения, развернутая в настоящее время в Heroku, нони один из моих файлов JS не загружается туда.Они загружаются и нормально работают на localhost: 3000.
Я подумал, что это проблема, связанная с Uglifier.После прочтения аналогичной проблемы другого человека на SO, я попробовал его решение понизить самоцвет Uglifier;Мой Gemfile ранее указывал '> = 1.3.0', поэтому Heroku автоматически установил 4.1.20.Поэтому я изменил свой Gemfile на: gem 'uglifier', '~> 3.0.4').
Однако, когда я сейчас нажимаю на Heroku, я получаю следующее сообщение об ошибке:
...
remote: Installing uglifier 3.0.4
remote: Bundle complete! 24 Gemfile dependencies, 77 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 (3.33s)
remote: Cleaning up the bundler cache.
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Removing uglifier (4.1.20)
remote: The latest bundler is 2.0.1, but you are currently running 1.15.2.
remote: To update, run `gem install bundler`
remote: -----> Installing node-v10.14.1-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: rake aborted!
remote: ArgumentError: Invalid option: harmony
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/uglifier-3.0.4/lib/uglifier.rb:129:in `block in initialize'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/uglifier-3.0.4/lib/uglifier.rb:128:in `each'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/uglifier-3.0.4/lib/uglifier.rb:128:in `initialize'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/config/environments/production.rb:26:in `new'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/config/environments/production.rb:26:in `block in <main>
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/railtie.rb:216:in `instance_eval'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/railtie.rb:216:in `configure'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/config/environments/production.rb:1:in `<main>'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:602:in `block (2 levels) in <class:Engine>'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:601:in `each'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:601:in `block in <class:Engine>'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:50:in `each'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:50:in `tsort_each_child'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/config/environment.rb:5:in `<main>'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:337:in `require_environment!'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:520:in `block in run_tasks_blocks'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
remote: /tmp/build_5ce011f911fe1c351bbce1885a611ecb/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
remote: Tasks: TOP => environment
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
Строка 26 моего файла production.rb:
config.assets.js_compressor =Uglifier.new (гармония: правда)
Есть идеи, что я делаю не так?Разве гармония не совместима с этой версией Uglifier?