当我尝试启动我的Rails服务器,我得到以下错误:
我使用的是ruby 1.9.2
=> Booting WEBrick => Rails 3.1.8 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/agent/agent.rb:318:in `log_app_names': undefined method `join' for nil:NilClass (NoMethodError) from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/agent/agent.rb:439:in `start' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/control/instance_methods.rb:95:in `start_agent' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/control/instance_methods.rb:83:in `init_plugin' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/newrelic_rpm.rb:36:in `block in <class:Railtie>' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:30:in `instance_exec' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:30:in `run' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:55:in `block in run_initializers' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:54:in `each' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:54:in `run_initializers' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/application.rb:96:in `initialize!' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/railtie/configurable.rb:30:in `method_missing' from /Users/toptier/Desktop/Proyectos/CursoIngles/config/environment.rb:5:in `<top (required)>' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `require' from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `block in require'
它使用以下gem:newrelic_rpm(3.4.2).
如果我在gemfile中评论newrelic line,它的效果很好,
任何想法?
解决方法
我在New Relic工作,我们跟踪了这个问题.
当nil被明确设置为应用程序名称时,会发生这种情况,这通常用于本地开发从ENV [“NEW_RELIC_APP_NAME”]拉取其应用程序名称的英雄应用程序.由于此环境变量通常不会在本地设备上设置,因此它将以代理程序的配置为零,并崩溃本地服务器.它不会影响设置此变量的应用程序的部署版本.
显然,代理人应该优雅地处理这种情况,我们将在第二天或者两天内补丁.我们刚刚完成了代理商配置的重大重构,而这个边缘案例在我们的内部测试中被错过了.
etoleb在评论中给出了很好的解决方法.我们非常抱歉让你感到头疼.
如果您有任何问题或疑虑,请直接发送电子邮件至sam@newrelic.com.
谢谢!