我希望有人可以帮助我,我将首先体验通过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
我认为我错过了一个设置或变量?
答案 0 :(得分:5)
你有一个错字;该行应该是:
require 'capistrano/ext/multistage'