assets:precompile connects to DB when initialize_on_precompile is false

I have config.assets.initialize_on_precompile = false in my config/application.rb and bundle exec rake assets:precompile still attempts to connect to my DB. I changed my db name in database.yml to a non-existent database so I can tell when it's trying to connect.

$ be rake assets:precompile
rake aborted!
FATAL:  database "aaa" does not exist

Answers


According to Heroku, this config is only available in Rails 3.x. You can also see here in rails/rails repo on Rails 4 that the config for assets isn't there anymore: https://github.com/rails/rails/blob/master/railties/lib/rails/application/configuration.rb

For quick assets compiling, I use a simple sqlite3 config in production. It always connects no matter what. Your database.yml file should not be taken as is from your repo in production anyway. Either you use Heroku or a simple capistrano symlink to your shared folder, or any other custom solution.


Need Your Help

NSImage returns nil even when png file is in Resource folder

objective-c nsimage nsimageview nsalert

I'm trying to load an image using NSImage imageNamed: method but i have no success

Webpack Loader not Working on Jenkins CI Build

javascript jenkins gruntjs docker webpack

I'm trying to integrate Weback into my current project and am having problems with a custom loader I built to create a concat banner and footer around each module's file contents, and to inject the