ruby-on-rails – 使用Capistrano进行部署 – 仅适用于匹配的服
发布时间:2020-12-16 21:46:08 所属栏目:百科 来源:网络整理
导读:我试图使用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 :applic
我试图使用Capistrano部署我的应用程序,但我收到这个错误消息:
运行此命令时: 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”而不是“角色”,但你应该在进行更改之前确认. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |