Capistrano 3, Rails 4, database configuration does not specify adapter

前端 未结 6 941
半阙折子戏
半阙折子戏 2020-12-24 14:47

When I start

cap production deploy

it fails like this:

DEBUG [4ee8fa7a] Command: cd /home/deploy/myapp/releases/         


        
6条回答
  •  天命终不由人
    2020-12-24 15:04

    Based on Marc's answer which definitely seems to be the right one,

    you can workaround this until it is fixed upstream by adding this to your config/deploy.rb in the "namespace :deploy" block:

      desc 'Provision env before assets:precompile'
      task :fix_bug_env do
        set :rails_env, (fetch(:rails_env) || fetch(:stage))
      end
    
      before "deploy:assets:precompile", "deploy:fix_bug_env"
    

    This will force loading the env and provisionning RAILS_ENV before assets:precompile is called.

提交回复
热议问题