Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何从Capistrano启动1名生产工人?_Ruby On Rails_Ruby On Rails 3_Capistrano_Background Process_Resque - Fatal编程技术网

Ruby on rails 如何从Capistrano启动1名生产工人?

Ruby on rails 如何从Capistrano启动1名生产工人?,ruby-on-rails,ruby-on-rails-3,capistrano,background-process,resque,Ruby On Rails,Ruby On Rails 3,Capistrano,Background Process,Resque,我已经安装了Redis/Resque,但在部署时,我很难从Capistrano启动/重新启动它 我的需求相当简单:我只有一个队列,只需要一个工人,而且我没有使用monit或god 基于,my deploy.rb具有以下特性: namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles => :app, :except => { :no_release => t

我已经安装了Redis/Resque,但在部署时,我很难从Capistrano启动/重新启动它

我的需求相当简单:我只有一个队列,只需要一个工人,而且我没有使用monit或god

基于,my deploy.rb具有以下特性:

namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end

  task :restart_resque do 
    pid_file = "#{shared_path}/pids/resque.pid" 
    run "test -f #{pid_file} && cd #{current_path} && kill -s QUIT `cat #{pid_file}` || rm -f #{pid_file}"
    run "cd #{current_path}; RAILS_ENV=production QUEUE='*' VERBOSE=1 nohup rake environment resque:work& > #{shared_path}/log/resque.log && echo $! > #{pid_file}"
  end

end

after 'deploy:restart', 'deploy:restart_resque'
我的resque.rake文件(基于Railscast)具有:


当我
capdeploy
时,一切似乎都正常,但当我查看resque web时,没有工作人员在运行

我建议你看看这个,并提出一些建议

require "resque/tasks"  

task "resque:setup" => :environment