我试图使用Capistrano部署我的应用程序,但我收到这个错误消息:
`deploy:setup’ is only run for servers matching {:except=>{:no_release=>true}},but no servers matched
运行此命令时:
bundle exec cap deploy:setup
这是我的deploy.rb文件.
set :application,"example.com" set :repository,"git@github.com:username/repo.git" set :use_sudo,false set :scm,:git set :web,application set :app,application set :db,application set :branch,"master" set :user,"webmaster" set :deploy_to,"/opt/www/#{application}" set :deploy_via,:remote_cache set :domain,application set :port,2222 set :bundler_cmd,"bundle install --deployment --without=development,test" ssh_options[:paranoid] = false namespace :deploy do task :start do ; end task :stop do ; end task :restart_stalker do run "cd #{deploy_to}/current && thor stalker:kill && stalker:init" end task :restart,:roles => :app,:except => { :no_release => true } do run "cd #{deploy_to}/current && touch tmp/restart.txt" end after "bundler_cmd","deploy:restart_stalker" end
我使用的是Rails 3.
解决方法
您需要定义一些角色.例如.:
role :app,'myapphostname' role :web,'mywebhostname'
看来你使用“set”而不是“角色”,但你应该在进行更改之前确认.