Capistrano部署“任务分期不存在”

时间:2013-02-05 11:33:31

标签: ruby deployment capistrano web-deployment

我希望有人可以帮助我,我将首先体验通过capistrano部署网站的经验,但是每当我运行cap deploy:check时我都会收到错误任务`staging'不存在,有什么问题?

这是我的deploy.rb

set :application, "Myproject"
set :repository, "******@bitbucket.org/simonainley/myproject.git"

set :scm, :git
set :ssh_options, {:forward_agent =>true}

set :stages, %w(staging production)
set :default_stage, "staging"
require 'capistrano/ext/miltistage'

这是我的staging.rb

role :server, "**.**.**.***"
set :user, "user"
set :password, "password"

set :branch, "dev"
set :web_directory, "/home/***/public_html/staging/****"

namespace :deploy do |
    desc "Deploys code to the staging enviroment."
    task :default_stage, :roles => :server, :except => {:;no_release => true}
        run [
            "cd #{web_directory}",
            "git reset --hard",
            "git checkout #{branch}",
            "git fetch",
            "git pull origin #{branch}" ].join("; ")
    end
end

我认为我错过了一个设置或变量?

1 个答案:

答案 0 :(得分:5)

你有一个错字;该行应该是:

require 'capistrano/ext/multistage'