Get your own customer support community
 

Adding gem dependency in environment-specific file does not work

I tried only adding newrelic_rpm as a gem dependecy to the production environment (didn't want it loaded in development) and got obscure errors: Uninitialized Constant: NewRelic::Agent
that occured when adding "config.gem 'newrelic_rpm', :version => '>=2.8.1'" to my production.rb
it ran fine when adding the same line to environment.rb

backtrace:
> rake production db:charset --trace >> ~/Desktop/backtrace.txt
DEPRECATION WARNING: The fragment_cache_store= method is now use cache_store= See http://www.rubyonrails.org/deprecation for details. (called from fragment_cache_store= at /Library/Ruby/Gems/1.8/gems/actionpack-2.1.2/lib/action_controller/caching/fragments.rb:33)
rake aborted!
uninitialized constant NewRelic::Agent
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:276:in `load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:468:in `const_missing'
/Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.8.1/lib/new_relic/config.rb:190:in `start_agent'
/Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.8.1/lib/new_relic/config/rails.rb:25:in `start_plugin'
/Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.8.1/lib/newrelic_rpm.rb:22
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/initializer.rb:476:in `call'
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/initializer.rb:476:in `after_initialize'
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/initializer.rb:475:in `each'
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/initializer.rb:475:in `after_initialize'
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/initializer.rb:152:in `process'
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/initializer.rb:97:in `send'
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/initializer.rb:97:in `run'
/Users/gerrit/Development/trike/pedia/config/environment.rb:13
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.1.2/lib/tasks/misc.rake:3
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
 
sad I’m annoyed
Inappropriate?
1 person has this problem

The company has acknowledged this problem.


User_default_medium