Push Rails / ClearDB Application for Heroku Error 'Unable to connect to MySQL server on' 127.0.0.1 '

Every time I run:

git push heroku master 

I get the following error:

 Running: rake assets:precompile rake aborted! Can't connect to MySQL server on '127.0.0.1' 

I run

 rails -v Rails 3.2.11 

and

 ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0] 

I installed ClearDB via the Heroku CLI and it seems to be working fine, but I cannot figure out this error.

Here is my yml for production:

 production: adapter: mysql2 encoding: utf8 host: localhost database: pm_production username: root password: root allow_concurrency: true pool: 5 
+6
source share
1 answer

Your application is trying to initialize during asset compilation. heroku docs explicitly recommend disabling application initialization on precompile by changing your config/application.rb :

 config.assets.initialize_on_precompile = false 
+17
source

All Articles