ruby-on-rails – 使用Capistrano进行部署 – 仅适用于匹配的服务器

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 使用Capistrano进行部署 – 仅适用于匹配的服务器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图使用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”而不是“角色”,但你应该在进行更改之前确认.

原文链接:https://www.f2er.com/ruby/266944.html

猜你在找的Ruby相关文章