gpt4 book ai didi

ruby-on-rails-3 - 错误——: uninitialized constant Airbrake (NameError)

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

我正在处理一个 rails 3.2.8 项目,我刚刚安装了 airbrake gem 来跟踪错误,在开发中我做了 airbrake 安装步骤,然后当我使用 capistrano 进行部署时,我在 unicorn 中遇到了以下错误生产日志:

E, [2012-10-16T03:02:51.588084 #3645] ERROR -- : reaped #<Process::Status: pid 3846 exit 1> worker=3
I, [2012-10-16T03:02:51.588434 #3645] INFO -- : worker=3 spawning...
I, [2012-10-16T03:02:51.708539 #3858] INFO -- : worker=3 spawned pid=3858
I, [2012-10-16T03:02:51.708986 #3858] INFO -- : Refreshing Gem list
E, [2012-10-16T03:02:52.793217 #3849] ERROR -- : uninitialized constant Airbrake (NameError)
/home/ubuntu/apps/nimrod/releases/20121011033552/config/initializers/airbrake.rb:1:in `<top (required)>'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:587:in `each'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:587:in `block in <class:Engine>'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/ubuntu/apps/nimrod/releases/20121011033552/config/environment.rb:5:in `<top (required)>'
config.ru:4:in `require'
config.ru:4:in `block in <main>'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn.rb:44:in `eval'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn.rb:44:in `block in builder'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:696:in `call'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:696:in `build_app!'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:569:in `init_worker_process'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:589:in `worker_loop'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:498:in `maintain_worker_count'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:272:in `join'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/bin/unicorn:121:in `<top (required)>'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/bin/unicorn:19:in `load'
/home/ubuntu/apps/nimrod/shared/bundle/ruby/1.9.1/bin/unicorn:19:in `<main>'

我注意到 airbrake gem 与所有其他 gem 一起安装在 shared/bundle/ruby/1.9.1/gems 中。

在生产中,我正在运行带有 unicorn 的 Ubuntu 12.04 x64 和 nginx 和 ruby​​ 1.9.3-p194,以及这个 gems
Using airbrake (3.1.4) 
Using capistrano (2.12.0)
Using bundler (1.1.4)
Using rails (3.2.8)
Using unicorn (4.3.1)

还尝试停止 nginx、unicorn 然后重新启动它们,但没有用

我希望有人能帮我解决这个问题

最佳答案

更新我的包后我遇到了类似的错误。

似乎您必须在您的 airbrake 初始值设定项(config/initializers/airbrake.rb 或 config/initializers/errbit.rb)中要求 rake_handler:

require 'airbrake/rake_handler'

关于ruby-on-rails-3 - 错误——: uninitialized constant Airbrake (NameError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12907034/

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