gpt4 book ai didi

ruby-on-rails - 将 rails 应用程序部署到 Heroku 错误 ArgumentError : Invalid option: harmony

转载 作者:行者123 更新时间:2023-12-03 19:27:07 25 4
gpt4 key购买 nike

我完成了我的博客,我正在尝试将它部署到 heroku,但我不断收到此错误。

我已经尝试更改我的 production.rb、Gemfile 和 application.js,这些都是从其他有相同问题的人那里得到的建议,但都没有奏效。这是我所做的

我把我的 production.rb 改成了这个

        config.assets.js_compressor = Uglifier.new(harmony: true)

应用程序.js:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require ckeditor/init
//= require_tree .

我已经将 jquery_ujs 更改为 rails_ujs 并且它没有改变任何东西

文件

ruby '2.5.1'

group :production do
gem 'pg'
gem 'rails_12factor'
end

group :development do
gem 'sqlite3', '~> 1.3.6'
end

gem 'rails', '~> 5.2.1'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.0.3', require: 'uglifier'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'redcarpet', '~> 3.4'
gem 'pygments.rb', '~> 1.2', '>= 1.2.1'
gem 'friendly_id', '~> 5.2', '>= 5.2.4'
gem 'will_paginate', '~> 3.1', '>= 3.1.6'
gem 'mail_form', '~> 1.5', '>= 1.5.1'
gem 'devise', '~> 4.2'
gem "paperclip", "~> 6.0.0"
gem 'ckeditor', '~> 4.1'
gem 'meta-tags', '~> 2.1'
gem 'rb-readline', '~> 0.5.3'
gem 'cancancan'
gem 'carrierwave'
gem 'mini_magick'
gem 'social-share-button'





group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]


这是我调用“git push heroku master”后的终端
remote:        Running: rake assets:precompile
remote: rake aborted!
remote: ArgumentError: Invalid option: harmony
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/uglifier-2.7.2/lib/uglifier.rb:168:in `block in initialize'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/uglifier-2.7.2/lib/uglifier.rb:167:in `each'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/uglifier-2.7.2/lib/uglifier.rb:167:in `initialize'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/config/environments/production.rb:26:in `new'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/config/environments/production.rb:26:in `block in <main>'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/railtie.rb:216:in `instance_eval'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/railtie.rb:216:in `configure'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/config/environments/production.rb:1:in `<main>'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:602:in `block (2 levels) in <class:Engine>'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:601:in `each'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:601:in `block in <class:Engine>'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `instance_exec'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `run'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `each'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:60:in `run_initializers'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:361:in `initialize!'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/config/environment.rb:5:in `<main>'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:337:in `require_environment!'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
remote: /tmp/build_08823881a010f97ecfcad2f83b760e2b/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_08823881a010f97ecfcad2f83b760e2b/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/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
remote: Verifying deploy...
remote:
remote: ! Push rejected to obscure-harbor-21335.

任何帮助将不胜感激谢谢

最佳答案

看起来你的 uglifier 版本还不支持和声参数。

升级你的 uglifier gem 。

例如,放置 gem 'uglifier', '~> 4.2'在您的 Gemfile 中,而不是 gem 'uglifier', '>= 1.0.3'将解决您的问题。

关于ruby-on-rails - 将 rails 应用程序部署到 Heroku 错误 ArgumentError : Invalid option: harmony,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56916950/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com