Ruby on rails 重新确认返回的作业,但出现错误:“quot;没有这样的文件或目录-getcwd";

Ruby on rails 重新确认返回的作业,但出现错误:“quot;没有这样的文件或目录-getcwd";,ruby-on-rails,resque,Ruby On Rails,Resque,我有一个非常简单的工作: class MyJob @queue = :high def self.perform(user_id) user = User.find(user_id) MyMailer.send_email(user).deliver end end 如果我手动运行它MyJob.perform(some\u id)。但是,当Rescue执行时,它返回以下错误: Exception Errno::ENOENT Error No su

我有一个非常简单的工作:

class MyJob
  @queue = :high

  def self.perform(user_id)
    user = User.find(user_id)
    MyMailer.send_email(user).deliver
  end

end
如果我手动运行它
MyJob.perform(some\u id)
。但是,当Rescue执行时,它返回以下错误:

Exception
    Errno::ENOENT Error
    No such file or directory - getcwd

 shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_view/template/resolver.rb:221:in `expand_path'  shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_view/template/resolver.rb:221:in `initialize'  shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_view/template/resolver.rb:251:in `new'  shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_view/template/resolver.rb:251:in `instances'  shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_view/lookup_context.rb:16:in `<class:LookupContext>'  shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_view/lookup_context.rb:12:in `<module:ActionView>'  shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_view/lookup_context.rb:5:in `<top (required)>'  shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/abstract_controller/view_paths.rb:45:in `lookup_context'  shared/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/base.rb:456:in `process'  shared/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/base.rb:452:in `initialize'  shared/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/base.rb:439:in `new'  shared/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_mailer/base.rb:439:in `method_missing'  releases/1111111111111/app/jobs/my_job.rb:6:in `perform'
异常
Errno::enoint错误
没有这样的文件或目录-getcwd
shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action\u view/template/resolver.rb:221:in‘expand\u path’shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/gems/actionpack-3.2.12/lib/action\u view/template/resolver.rb:221:in‘initialize’shared/bundle/ruby/1.9.1.1/gems/actionpack/3.2.12/lib/action\u view/template/resolvershared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action\u view/template/resolver.rb:251:in`instances'shared/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action\u view/lookup\u context.rb:16:in``共享/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action\u view/lookup\u上下文共享/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action\u view/lookup\u context.rb:5:in``共享/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/abstract\u controller/view\u path.rb:45:in`lookup\u context'共享/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action\u mailer/base.456:in`进程'shared/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/lib/action_-mailer/base.rb:452:in‘initialize’shared/bundle/ruby/1.9.1/gems/actionmailer-3.2.12/gems/actionmailer-3.2.12/lib/action_-mailer/base.rb:439:in‘method_missing’releases/1111/1111/app/jobs/my_.6:in‘执行
你知道为什么会发生吗


谢谢

我开始在我的生产环境中遇到同样的问题。经过一些调查,我发现这是由于我的resque工作人员未能在每次capistrano部署时正确重新启动造成的

是的,天空。你说得对,它需要重新启动

有些人在尝试从已删除的目录运行后收到此错误

在切换数据库并保持服务器运行后,我收到了此错误。旧的服务器信息仍然显示,但我得到了这个错误。重新启动了rails服务器,新数据库一切正常


基本上,这意味着服务器上的状态发生了重大变化,您的环境需要重置/重新启动。

如何手动重新启动它们?rake resque:scheduler RAILS_ENV=production???Sky mayhew您是如何解决这个问题的?