gpt4 book ai didi

ruby-on-rails - Rails刹车未定义方法

转载 作者:行者123 更新时间:2023-12-03 16:12:23 26 4
gpt4 key购买 nike

我一直在运行Rails应用程序,直到昨天运行良好,但是今天当我运行Rails Server时却出现了这个错误。尽管我的空中刹车也没有任何错误
[airbrake.rb]

Airbrake.configure do |config|
config.api_key = APP_CONFIG.airbrake.api_key
config.host = APP_CONFIG.airbrake.host
config.port = APP_CONFIG.airbrake.port
config.secure = config.port == 443
end

undefined method `api_key=' for #<Airbrake::Config:0x000000073fa1e0> (NoMethodError)
from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:98:in

configure'
from /home/techbirds/icare-master/config/initializers/airbrake.rb:1:in
' from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in load'
from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in
block in load' from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/activesupport-

最佳答案

看来您无意中升级到了new v5 Airbrake gem。您可以:

  • 按照migration guide从airbrake v4迁移到v5或
  • 将airbrake锁定到gemfile中的v4,例如像gem 'airbrake', '~> 4.3.4'
  • 关于ruby-on-rails - Rails刹车未定义方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34450464/

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