由于新的遗留错误,Rails服务器无法启动

Ton*_*ony 12 ruby-1.9.2 ruby-on-rails-3.1 newrelic

当我尝试启动我的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'
Run Code Online (Sandbox Code Playgroud)

它使用以下gem:newrelic_rpm(3.4.2).如果我在gemfile中评论newrelic line它运行良好,

任何的想法?

sam*_*amg 10

我在New Relic工作,我们已经找到了问题所在.

nil显式设置为应用程序名称时会发生这种情况,这通常适用于从中提取应用程序名称的heroku应用程序的本地开发ENV["NEW_RELIC_APP_NAME"].由于此环境变量通常不在您的本地开发框中设置,因此它将代理的配置作为nil进入并崩溃本地服务器.它不会影响已设置此变量的应用程序的已部署版本.

显然,代理人应该优雅地处理这个案子,我们将在接下来的一两天内修补.我们刚刚完成了代理配置的重大重构,这个边缘案例在我们的内部测试中被遗漏了.

etoleb在评论中提供了一个很好的解决方法.我们非常抱歉让你头疼.

如果您有任何问题或疑虑,请随时发送电子邮件至sam@newrelic.com.

谢谢!