rake assets:precompile attempting to connect to database

前端 未结 6 834
余生分开走
余生分开走 2020-12-14 06:24

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 so

6条回答
  •  醉梦人生
    2020-12-14 06:58

    Check your configuration files (in all environments). If for example

    rake assets:precompile
    

    works in development, but you are having issues in production

    RAILS_ENV=production bundle exec rake assets:precompile
    

    then you most likely have a reference to active record in your /config/environments/production.rb

    config.active_record.dump_schema_after_migration = false
    

    In order to avoid that altogether if you are planning on not taking advantage of active record or employing a NoSQL such as mongo, you may wish to initialize your new app as follows:

    rails new myApp --skip-active-record
    

    which is equivalent to -O (capital O) as far as I am concerned.

提交回复
热议问题