gpt4 book ai didi

ruby-on-rails - Resque 作业返回错误 : "No such file or directory - getcwd"

转载 作者:行者123 更新时间:2023-12-02 00:08:16 26 4
gpt4 key购买 nike

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

class MyJob
@queue = :high

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

end

如果我手动运行它MyJob.perform(some_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'

知道为什么会发生这种情况吗?

谢谢!

最佳答案

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

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

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

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

关于ruby-on-rails - Resque 作业返回错误 : "No such file or directory - getcwd",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16991222/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com