gpt4 book ai didi

ruby-on-rails - 在 heroku 上部署 Rails 失败,出现 NameError : wrong constant name [[:error, ["detected unsupported rails version 6.0.1"], nil]]

转载 作者:行者123 更新时间:2023-12-04 13:57:36 25 4
gpt4 key购买 nike

更新到 rails 6 后。我的 rails 应用程序在 localhost 中工作,但未能在 heroku 上部署。
使用 NameError: wrong constant name [[:error, ["detected unsupported rails version 6.0.1"], nil]]。
这是heroku日志

    Bundle completed (202.90s)
Cleaning up the bundler cache.
-----> Installing node-v10.15.3-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use `ActiveSupport::LoggerSilence` instead (called from <top (required)> at /tmp/build_beaa9fdc79751f9cff81884a8400ec45/config/application.rb:15)
Sending event 8d83a3662d87418682154b98aecd586c to Sentry
Unable to record event with remote Sentry server (Raven::Error - the server responded with status 429 Error in headers is: Creation of this event was denied due to rate limiting):
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/sentry-raven-2.12.2/lib/raven/transports/http.rb:34:in `rescue in send_event'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/sentry-raven-2.12.2/lib/raven/transports/http.rb:16:in `send_event'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/sentry-raven-2.12.2/lib/raven/client.rb:43:in `send_event'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/sentry-raven-2.12.2/lib/raven/instance.rb:81:in `send_event'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/sentry-raven-2.12.2/lib/raven/instance.rb:126:in `capture_type'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/ruby-2.6.5/lib/ruby/2.6.0/forwardable.rb:230:in `capture_exception'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/sentry-raven-2.12.2/lib/raven/integrations/rake.rb:9:in `display_error_message'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/rake-13.0.0/lib/rake/application.rb:195:in `rescue in standard_exception_handling'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/rake-13.0.0/lib/rake/application.rb:185:in `standard_exception_handling'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/rake-13.0.0/lib/rake/application.rb:80:in `run'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/rake-13.0.0/exe/rake:27:in `<top (required)>'
Failed to submit event: NameError: wrong constant name [[:error, ["detected unsupported rails version 6.0.1"], nil]]
rake aborted!
NameError: wrong constant name [[:error, ["detected unsupported rails version 6.0.1"], nil]]
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-5.7.0.350/lib/new_relic/control/class_methods.rb:52:in `const_get'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-5.7.0.350/lib/new_relic/control/class_methods.rb:52:in `load_framework_class'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-5.7.0.350/lib/new_relic/control/class_methods.rb:32:in `new_instance'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-5.7.0.350/lib/new_relic/control/class_methods.rb:13:in `instance'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-5.7.0.350/lib/newrelic_rpm.rb:41:in `block in <class:Railtie>'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `instance_exec'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `run'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:60:in `run_initializers'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:363:in `initialize!'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/config/environment.rb:5:in `<top (required)>'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:339:in `require_environment!'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:515:in `block in run_tasks_blocks'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/tmp/build_beaa9fdc79751f9cff81884a8400ec45/vendor/bundle/ruby/2.6.0/gems/rake-13.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)

最佳答案

升级、fork&patch 或临时禁用 new_relic gem。
目前,new_relic 7.2 最多支持 rails 6。
所以你很快就会在 Rails 7 中再次遇到这个错误

NameError: wrong constant name [[:error, ["Detected unsupported Rails version 7.0.0.alpha2"], nil]]
更改此行以支持 rails 7
https://github.com/newrelic/newrelic-ruby-agent/blob/7.2.0/lib/new_relic/agent/configuration/default_source.rb#L130
https://github.com/newrelic/newrelic-ruby-agent/blob/7.2.0/lib/new_relic/agent/configuration/default_source.rb#L124-L135

关于ruby-on-rails - 在 heroku 上部署 Rails 失败,出现 NameError : wrong constant name [[:error, ["detected unsupported rails version 6.0.1"], nil]],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58770480/

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