Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake assets:precompile attempting to connect to database

I'm attempting to debug why my application is attempting to connect to my database when I run rake assets:precompile --trace.

I'm probably missing something in the stack trace...anyone see the pertinent line?

DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionController::Base instead. (called from <top (required)> at /Users/Kyle/Desktop/skateparks-web/config/application.rb:4) ** Invoke assets:precompile (first_time) ** Execute assets:precompile /Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionController::Base instead. (called from <top (required)> at /Users/Kyle/Desktop/skateparks-web/config/application.rb:4) ** 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! FATAL:  database "skateparks_production" does not exist /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `initialize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `new' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `connect' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:316:in `initialize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `new' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `postgresql_connection' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout' /Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/model_schema.rb:308:in `clear_cache!' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activerecord-3.2.0/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:418:in `_run__2041913228368879189__prepare__1991931652306887621__callbacks' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/application/finisher.rb:48:in `block in <module:Finisher>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing' /Users/Kyle/Desktop/skateparks-web/config/environment.rb:5:in `<top (required)>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.2.0/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' /Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:89:in `block (2 levels) in <top (required)>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' /Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:174:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' /Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:56:in `block (3 levels) in <top (required)>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' /Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:59:in `run' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/bin/rake:32:in `<top (required)>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/bin/rake:19:in `load' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/bin/rake:19:in `<main>' Tasks: TOP => environment rake aborted! Command failed with status (1): [/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/bi...] /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `call' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `sh' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `sh' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:78:in `ruby' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `ruby' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:9:in `ruby_rake_task' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' /Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `each' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/lib/rake/application.rb:59:in `run' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rake-0.9.2/bin/rake:32:in `<top (required)>' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/bin/rake:19:in `load' /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/bin/rake:19:in `<main>' Tasks: TOP => assets:precompile 
like image 832
Kyle Decot Avatar asked Jan 25 '12 02:01

Kyle Decot


People also ask

What does rake assets Precompile do?

rake assets:precompile. We use rake assets:precompile to precompile our assets before pushing code to production. This command precompiles assets and places them under the public/assets directory in our Rails application.

How do I Precompile assets in Heroku?

To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.


1 Answers

rake assets:precompile initializes your app by default, which includes connection to the database.

Inside config/application.rb you can add this, but see the link below for warnings about it:

config.assets.initialize_on_precompile = false 

Rails Guide on Precompiling Assets

like image 134
Dylan Markow Avatar answered Oct 01 '22 12:10

Dylan Markow