2014-08-29 81 views
1

我使用Capistrano 3.2.1與Ruby 2.1.1和Rails 4.1.4,由於某些原因,我無法運行遷移。cap部署不運行遷移

我試着運行cap staging deploy(部署但不運行遷移),cap staging deploy:migrate(什麼都不做),cap staging deploy:migrations(不知道如何構建任務)。

的Gemfile:

group :development, :test do 
    gem 'capistrano', '~> 3.2.1' 
    gem 'capistrano-rails', '~> 1.1.1' 
    gem 'capistrano-rvm' 
end 

Capfile:

set :deploy_config_path, 'config/capistrano/deploy.rb' 
set :stage_config_path, 'config/capistrano/deploy' 

require 'capistrano/setup' 
require 'capistrano/deploy' 
require 'capistrano/rails' 
require 'capistrano/rvm' 

Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } 

回答

2

短行程Capistrano的護欄github上解決了這個問題。我錯過了我的網絡服務器db作用...

3

你需要添加require 'capistrano/rails/migrations'您Capfile

1

運行「帽部署:遷移」等同於運行「上限部署」 & &隨後「帽部署:遷移「在一個命令。

要查看描述了部署:遷移,只需使用-e選項:

帽-e部署:遷移

會給你這樣的輸出:

cap deploy:migrations 

Deploy and run pending migrations. This will work similarly to the 'deploy' task, but will also run any pending migrations (via the 'deploy:migrate' task) prior to updating the symlink. Note that the update in this case it is not atomic, and transactions are not used, because migrations are not guaranteed to be reversible.