Ruby on rails 为什么Capistrano部署没有为bundle exec rake db:migrate提供匹配的主机?

Ruby on rails 为什么Capistrano部署没有为bundle exec rake db:migrate提供匹配的主机?,ruby-on-rails,ruby,ruby-on-rails-4,capistrano,Ruby On Rails,Ruby,Ruby On Rails 4,Capistrano,我和capistrano一起部署,我是strugg;ling想知道为什么在我尝试部署站点时它不会运行迁移 以下是全部错误: WARN [SKIPPING] No Matching Host for /usr/bin/env if test ! -d /home/deploy/forge_staging/releases/20140319132005; then echo "Directory does not exist '/home/deploy/forge_staging/releases

我和capistrano一起部署,我是strugg;ling想知道为什么在我尝试部署站点时它不会运行迁移

以下是全部错误:

 WARN [SKIPPING] No Matching Host for /usr/bin/env if test ! -d /home/deploy/forge_staging/releases/20140319132005; then echo "Directory does not exist '/home/deploy/forge_staging/releases/20140319132005'" 1>&2; false; fi
 WARN [SKIPPING] No Matching Host for bundle exec rake db:migrate
这是我的设置:

deploy.rb staging.rb 这是角色的问题吗?

从deploy.rb中删除:(添加capistrano bundler并在Capfile中要求它)

从staging.rb中删除:

role :app, %w{deploy@xxx.xxx.xxx.xxx}
role :web, %w{deploy@xxx.xxx.xxx.xxx}
role :db,  %w{deploy@xxx.xxx.xxx.xxx}
set :migration_role, 'migrator'            # <= this is why you got the error
角色:应用程序,%w{deploy@xxx.xxx.xxx.xxx}
角色:web%w{deploy@xxx.xxx.xxx.xxx}
角色:db,%w{deploy@xxx.xxx.xxx.xxx}
设置:迁移\u角色“迁移者”#
role :app, %w{deploy@xxx.xxx.xxx.xxx}
role :web, %w{deploy@xxx.xxx.xxx.xxx}
role :db,  %w{deploy@xxx.xxx.xxx.xxx}

# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server
# definition into the server list. The second argument
# something that quacks like a hash can be used to set
# extended properties on the server.
# server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value

set :stage, :staging

server "xxx.xxx.xxx.xxx", user: "deploy", roles: %w{web app db}
set :deploy_to, "/home/deploy/forge_staging"

set :rails_env, 'staging'                  # If the environment differs from the stage name
set :migration_role, 'migrator'            # Defaults to 'db'

set :branch, ENV["REVISION"] || ENV["BRANCH_NAME"] || "master"
server "xxx.xxx.xxx.xxx"
SSHKit.config.command_map[:rake]  = "bundle exec rake"
SSHKit.config.command_map[:rails] = "bundle exec rails"
set :user, "deploy"   # you have it in staging.rb
set :use_sudo, false  # not used in cap3
role :app, %w{deploy@xxx.xxx.xxx.xxx}
role :web, %w{deploy@xxx.xxx.xxx.xxx}
role :db,  %w{deploy@xxx.xxx.xxx.xxx}
set :migration_role, 'migrator'            # <= this is why you got the error