uninitialized constant ActionController::Caching::Sweeper - ruby-on-rails

When precompiling production environment I receive an uninitialized constant ActionController::Caching::Sweeper error (same with heroku). In the development environment and with localhost everything is working fine. Thx for any suggestions.
C:\Sites\code\myapp>bundle exec rake assets:precompile RAILS_ENV=production --trace
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant ActionController::Caching::Sweeper
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/spree_reviews-5447d2231446/app/models/spree/review_sweeper.rb:1:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
C:in `eager_load!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
C:/Sites/code/farmfood/config/environment.rb:5:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => environment

This is due to a bug in the rails-observers gem. The bug has been fixed, but the fix has not yet reached rubygems.org.
Use the version of rails-observers from GitHub, by replacing this line in your Gemfile:
gem 'rails-observers'
With this one:
gem 'rails-observers', git: 'https://github.com/rails/rails-observers.git'

This is a bug in rails-observers. https://github.com/rails/rails-observers/issues/4

Thx #khustochka to bringing me on the right track
I solved my problem with:
Installing the gem 'rails-observers'
https://github.com/rails/rails-observers
Then I added to production.rb
config.dependency_loading = true if $rails_rake_task
config.active_record.observers = :contact_observer
Since I got uninitialized constant ActiveModel::Observer error
I created in app/models the file contact_observe.rb
class ContactObserver < ActiveRecord::Observer
observe :user
end
after I did rake db:migrate RAILS_ENV=production
and rake asset precompile RAILS_ENV=production
and my problem was fixed

This is happening because the spree_reviews extension is depending on a feature of Rails which has been removed in Rails 4. Please file an issue on that project about this problem.

Related

skipping initializer in development enviroment rails

When ever, I perform a rails test in cmd line, or rails db:migrate RAILS_ENV=test I keep getting a NoMethodError for my omniauth initialzer although the rails server works fine and so does, omniauth on my, heroku site where my code is pushed to. I read this question Rails: Per-environment initializers? and added if Rails.env.production? at the top of my omniauth initialzer file so to run the omniauth initialzer only for production but I am having no luck.
The full error is;
db:migrate RAILS_ENV=test --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rails aborted!
NoMethodError: undefined method `[]' for nil:NilClass
C:/Sites/Peoples_Profiles/config/initializers/omniauth.rb:5:in `block in <top (required)>'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.3.1/lib/omniauth/builder.rb:6:in `initialize'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/stack.rb:35:in `new'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/stack.rb:35:in `build'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/stack.rb:100:in `block in build'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/stack.rb:100:in `each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/stack.rb:100:in `inject'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/stack.rb:100:in `build'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:508:in `block in app'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:504:in `synchronize'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:504:in `app'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
C:/Sites/Peoples_Profiles/config/environment.rb:5:in `<top (required)>'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:328:in `require_environment!'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:448:in `block in run_tasks_blocks'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `call'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `block in execute'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `execute'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:209:in `block in invoke_prerequisites'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:207:in `each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:207:in `invoke_prerequisites'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:186:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task.rb:173:in `invoke'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:152:in `invoke_task'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `each'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block in top_level'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands/rake_proxy.rb:13:in `block in run_rake_task'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands/rake_proxy.rb:10:in `run_rake_task'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate => environment
Anyone got any ideas as to why this is?
added if Rails.env.production? at the top of my omniauth initialzer file
Just adding it at the top will do nothing. Wrap your logic in the conditional
if Rails.env.production?
# your omniauth stuff
end

`undefined method `default_timezone=' for ActiveRecord::Base:Class` on Ubuntu 14.04

I'm trying to set up an Ubuntu 14.04 instance to host a rails 4.2 application that I'm developing, but I keep hitting this same error, no matter how ruby/rails are installed. I'm using ruby 2.2.0, and rails 4.2.0
When I try to run any command that initialises rails, I get the following exception:
undefined method `default_timezone=' for ActiveRecord::Base:Class
This occurs when using ruby installed via the brightbox/ruby-ng apt repository, and when installed via rbenv and ruby-build. The application doesn't have this error with the same versions of ruby/rails installed on my OS X 10.10.2 machine.
Here's the full stack trace when running $ bin/rake db:migrate --trace:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
NoMethodError: undefined method `default_timezone=' for ActiveRecord::Base:Class
/var/lib/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/var/lib/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railtie.rb:71:in `block (2 levels) in <class:Railtie>'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/var/lib/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railtie.rb:69:in `block in <class:Railtie>'
/var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
/var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
/var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
/usr/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/usr/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
/usr/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
/usr/lib/ruby/2.2.0/tsort.rb:345:in `each'
/usr/lib/ruby/2.2.0/tsort.rb:345:in `call'
/usr/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
/usr/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
/usr/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
/var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
/var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
[redacted project dir]/config/environment.rb:5:in `<top (required)>'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:328:in `require_environment!'
/var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:443:in `block in run_tasks_blocks'
/usr/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/usr/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/usr/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/usr/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/usr/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/2.2.0/rake/task.rb:201:in `block in invoke_prerequisites'
/usr/lib/ruby/2.2.0/rake/task.rb:199:in `each'
/usr/lib/ruby/2.2.0/rake/task.rb:199:in `invoke_prerequisites'
/usr/lib/ruby/2.2.0/rake/task.rb:178:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/usr/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/usr/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/usr/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/usr/lib/ruby/2.2.0/rake/application.rb:75:in `run'
bin/rake:4:in `<main>'
Tasks: TOP => db:migrate => environment
I've tried setting config.time_zone and config.active_record.default_timezone in my config/application.rb file, but neither helped.
Does anyone have any suggestions to fix this?

rake db:schema:load works in development but not production

I have searched this site and Google for hours. When I run rake db:schema:load everything works fine (development), but running rake db:schema:load RAILS_ENV=production --trace I get the following:
C:\Sites\14-Meerkat>rake db:schema:load RAILS_ENV=production --trace
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
Mysql2::Error: Table 'sei_mk_prod.charities' doesn't exist: SHOW FULL FIELDS FROM `charities`
rake aborted!
Mysql2::Error: Table 'sei_mk_prod.charities' doesn't exist: SHOW FULL FIELDS FROM `charities`
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `query'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `block in execute'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:425:in `block in log'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:420:in `log'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `execute'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:220:in `execute'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:300:in `execute_and_free'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:461:in `columns'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/schema_cache.rb:114:in `block in prepare_default_proc'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/schema_cache.rb:56:in `yield'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/schema_cache.rb:56:in `columns'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/model_schema.rb:208:in `columns'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/model_schema.rb:247:in `column_names'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/auto_html-1.6.0/lib/auto_html/auto_html_for.rb:21:in `auto_html_for'
C:/Sites/14-Meerkat/app/models/charity.rb:9:in `<class:Charity>'
C:/Sites/14-Meerkat/app/models/charity.rb:1:in `<top (required)>'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:329:in `require_or_load'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:288:in `depend_on'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:206:in `require_dependency'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
C:in `eager_load!'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/tsort.rb:180:in `each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
C:/Sites/14-Meerkat/config/environment.rb:5:in `<top (required)>'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
C:/BitNami/rubystack-1.9.3-16-2/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
C:/BitNami/rubystack-1.9.3-16-2/ruby/bin/rake:23:in `load'
C:/BitNami/rubystack-1.9.3-16-2/ruby/bin/rake:23:in `<main>'
Tasks: TOP => db:schema:load => environment
Any thoughts?
The problem was in the charity.rb file of course. I haven't figured out the exact problem yet, but commenting out the code block starting at line 9 and a similar one in another model resolved the problem. Hope this helps some other frustrated programmer somewhere. :-)
Update:
One of my colleagues discovered he had initialized something in development.rb but not in production.rb. That initialization was for the code in charity.rb that was causing the problem.
See this question.
Which states
If you run rake db:schema:load on a production server, you'll end up deleting all your production data. This is a dangerous habit to get into.
Try running rake db:migrate. Keep running rake db:migrate. If you really need a fresh setup, did you try rake db:reset or rake db:setup?

Could not find table by rake routes on production server

When checking routes on production server with rake routes, there is an error of Could not find table 'authentify_engine_configs' which is a table in the database. What could cause this error? The following is full trace:
cjadmin#ubuntu-ibm:/var/www/nbhyop/current$ bundle exec rake routes --trace
** Invoke routes (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Could not find table 'authentify_engine_configs'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:472:in `table_structure'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:346:in `columns'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/model_schema.rb:228:in `yield'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/model_schema.rb:228:in `default'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/model_schema.rb:228:in `columns'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/model_schema.rb:237:in `columns_hash'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/locking/optimistic.rb:129:in `locking_enabled?'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/relation.rb:170:in `exec_queries'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/relation.rb:160:in `block in to_a'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/explain.rb:33:in `logging_query_plan'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/relation.rb:159:in `to_a'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/relation/finder_methods.rb:378:in `find_first'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.12/lib/active_record/relation/finder_methods.rb:122:in `first'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/bundler/gems/authentify-6d86f5486c71/app/custom/authentify/authentify_utility.rb:85:in `find_config_const'
/var/www/nbhyop/releases/20130514202149/config/initializers/my_constants.rb:7:in `<top (required)>'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `block in load'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/engine.rb:587:in `each'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/engine.rb:587:in `block in <class:Engine>'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/nbhyop/releases/20130514202149/config/environment.rb:6:in `<top (required)>'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/application.rb:103:in `require'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/application.rb:103:in `require_environment!'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.12/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/home/cjadmin/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'
/home/cjadmin/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/bin/rake:23:in `load'
/home/cjadmin/.rvm/gems/ruby-1.9.3-p286/bin/rake:23:in `<main>'
Tasks: TOP => routes => environment
cjadmin#ubuntu-ibm:/var/www/nbhyop/current$
It is rails 3.2.12 app running on ubuntu with nginx and passenger. rake db:migrate has the same error.
Thanks for help.
If it really is production then you need to tell rails, otherwise it will use development by default
RAILS_ENV=production bundle exec rake routes

Asset Precompile Error: uninitialized constant Mongo::Logging

I'm adding Asset Pipeline to my Heroku hosted Rails 3.1 App, and when I run
RAILS_ENV=production bundle exec rake assets:precompile
locally as suggested by Heroku here, it breaks with error:
rake aborted! uninitialized constant Mongo::Logging
Tasks: TOP => environment
I tried several steps, including the suggested Heroku
config.assets.initialize_on_precompile = false
The app crashes when I push it to production, with the same error. As I understand it, it's trying to use objects during compilation that are not yet initialized at this stage. What's the right way to do it?
[update] Stack Trace
ROOT /Users/bashar/rails-projects/myapp
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant Mongo::Logging
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rpm_contrib-2.1.8/lib/rpm_contrib/instrumentation/mongo.rb:14:in `block (2 levels) in <top (required)>'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:49:in `call'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:49:in `block in execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:48:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:48:in `execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:15:in `block in detect!'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:13:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:13:in `detect!'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/lib/new_relic/control/instrumentation.rb:94:in `_install_instrumentation'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/lib/new_relic/control/instrumentation.rb:53:in `install_instrumentation'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/lib/new_relic/control/instance_methods.rb:77:in `init_plugin'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/newrelic_rpm-3.3.3/lib/newrelic_rpm.rb:36:in `block in <class:Railtie>'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/bashar/rails-projects/myapp/config/environment.rb:5:in `<top (required)>'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:83:in `require_environment!'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:193:in `block (2 levels) in initialize_tasks'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/sprockets/assets.rake:89:in `block (2 levels) in <top (required)>'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/sprockets/assets.rake:56:in `block (3 levels) in <top (required)>'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/bashar/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/bashar/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => environment
rake aborted!
Command failed with status (1): [/Users/bashar/.rvm/rubies/ruby-1.9.2-p29...]
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:80:in `ruby'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/sprockets/assets.rake:9:in `ruby_rake_task'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/bashar/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/bashar/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/bashar/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile
Thanks
It's because you use the last rpm_contrib gem and not the last mongo-ruby-driver gem.
So you need desactivate MongoDB instrumentation on new_relic rpm. Or you can downgrade the version or rpm_contrib, or upgrade to Mongo ruby driver >= 1.6

Resources