我在Ruby2.1.1和Rails 4.1.4中使用Capistrano 3.2.1,由于某些原因,我无法运行迁移。
我试着运行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'
endCapfile:
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 }发布于 2014-08-29 03:26:51
去卡皮斯特拉诺-rails github的短途旅行解决了问题。我错过了我的网络服务器上的db角色.
发布于 2014-11-25 07:23:36
需要将require 'capistrano/rails/migrations'添加到Capfile中
发布于 2014-11-25 07:28:40
运行"cap :迁移“等同于运行"cap”&随后在一个命令中运行"cap :migrate“。
要查看部署:迁移的描述,只需使用-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.https://stackoverflow.com/questions/25561215
复制相似问题