I just installed the newrelic_rpm gem in my RefineryCMS Rails 3.2.3 application. I copied in the newrelic.yml config file as per the instructions. My app is being deployed with Heroku on the Cedar stack, so the instructions were pretty simple.
https://devcenter.heroku.com/articles/newrelic#cedar
However, running "rails server" on my development box gave me this error message:
/home/xxx/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
Setting the agent_enabled value to "false" in the newrelic.yml file allowed the server to start up again. Setting my license key and app name environment variables made no difference.
Interestingly, even though I couldn't get the app to start on my dev box, when I deployed it to Heroku, everything worked fine - and I am now getting new relic stats. Great!
My workaround has been to remove newrelic_rpm from the gemfile (which is what the install instructions say to do), and put it only into a :production group. Obviously, new relic is only useful in production, so it's no big deal.
group :production do
... other gems
gem 'newrelic_rpm'
end
Anyone else ever experienced this, or know why it should be causing an ActiveRecord error (with no mention in the error trace of new relic at all)?