2016-11-11 20 views
0

私はAWSにレールアプリを持っています。私はdb:resetをCapistranoでリセットし、2つの異なる宝石(capistrano-rails-dbとcapistrano-rails-collection)を試しましたが、動作しません。私も見つけたrecipeを試しましたが、うまくいきません。移行ではエラーは表示されませんが、新しいものは移行されません。Capistrano db:リセットが動作しない

cap deploy:invoke task="db:reset" 

使用例:

cap staging deploy:invoke task=db:seed 
cap deploy:invoke task=another:rake-task 

またはこれを:

答えて

0

これを試してみてください

bundle exec cap db:reset 


namespace :db do 
    desc 'Resets DB without create/drop' 
    task :reset do 
    on primary :db do 
     within release_path do 
     with rails_env: fetch(:stage) do 
      execute :rake, 'db:schema:load' 
      execute :rake, 'db:seed' 
     end 
     end 
    end 
    end 
end 

あなたは、それぞれのデプロイ環境ファイルに名前空間のコードを書く必要があります働い

+0

。ありがとうございました! –

関連する問題