Capistrano不承认多阶段阶段

swi*_*ams 8 deployment capistrano

我正在尝试将多级capistrano部署到我的生产和登台服务器.这是我的deploy.rb文件(省略scm详细信息):

require 'bundler/capistrano'
require 'whenever/capistrano'

set :application, "myapp"

set :stages, %w{staging, production}
set :default_stage, "staging"
require 'capistrano/ext/multistage'

set :deploy_to, "/webapps/myapp"

set(:domain) { "#{domain}" }
role(:web) { domain }
role(:app) { domain }
role(:db, :primary => true) { domain }

default_run_options[:pty] = true

namespace :one do
    task :foo do
        puts "foo"
    end
end
Run Code Online (Sandbox Code Playgroud)

并在config/deploy/production.rb:

set :domain, "production.com"
set :user, "prod"
Run Code Online (Sandbox Code Playgroud)

config/deploy/staging.rb:

set :domain, "shootsystage.com"
set :user, "stage"
Run Code Online (Sandbox Code Playgroud)

没什么太奇特的了(我想).跑步cap production one:foo很好.但运行cap staging one:foo结果:

the task `staging' does not exist
Run Code Online (Sandbox Code Playgroud)

这是怎么回事?

swi*_*ams 11

看起来像一小段语法咬我的屁股.它应该是:

set :stages, %w{staging production}
Run Code Online (Sandbox Code Playgroud)

注意在中缺少逗号%w{}.Ffffuuuuuuuuuuu ...