重新排序时出错

发布于 2024-10-08 15:07:19 字数 762 浏览 0 评论 0原文

为了在应用程序中实现resque,我遵循这个 示例。我只做了一项更改,即不从用户输入中获取“idea”变量值。我已经为这个变量给出了默认值。此代码 ruby​​ 文件位于 RAILS_ROOT/lib/ 文件夹中。 每当我使用命令 ruby​​ idea_analyzer.rb 运行程序时,我都会看到

[root@xxxxxx lib]# ruby idea_analyzer.rb
Analyzing your idea: I will learn ruby
Asking for a job to analyze: I
Asking for a job to analyze: will
Asking for a job to analyze: learn
Asking for a job to analyze: ruby

WordAnalyzer”

当我在控制台上运行 resque-web 命令并在浏览器中看到 sinatra 应用程序屏幕时,我会在失败队列中看到作业,并出现错误“未初始化常量 rake running: rake resque:work QUEUE=*

我的 redis 服务器正在运行。它显示连续的日志,例如
连接了 2 个客户端(0 个从属),使用了 471575 个字节,0 个共享对象

有人能告诉我这个错误吗?

提前致谢。

To implement resque in application, I am following the this example. I have done only one change, to not take 'idea' variable value from user input. I have given bydefault value for this variable. This code ruby files are in RAILS_ROOT/lib/ folder.
Whenever I run the program with command ruby idea_analyzer.rb, I see

[root@xxxxxx lib]# ruby idea_analyzer.rb
Analyzing your idea: I will learn ruby
Asking for a job to analyze: I
Asking for a job to analyze: will
Asking for a job to analyze: learn
Asking for a job to analyze: ruby

And when I run resque-web command on the console, and see sinatra app screen in the browser, I see job in failed queue with error 'uninitialized constant WordAnalyzer'

I have rake running: rake resque:work QUEUE=*

My redis-server is running. It shows continous logs like
2 clients connected (0 slaves), 471575 bytes in use, 0 shared objects

Can anyone tell me on this error?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一张白纸 2024-10-15 15:07:19

您可能需要更仔细地阅读它:

*如果您看到类似 no such file to load -- resque 的错误,那么您需要在程序顶部添加 require "rubygems" 。您最终应该会看到有关缺少 WordAnalyzer 的错误。接下来我将通过创建一个 word_analyzer.rb 文件来处理这个问题,定义类......*

You might want to read it more carefully:

*If you see an error like no such file to load -- resque, then you need to add require "rubygems" at the top of your program. You should eventually see the error about a missing WordAnalyzer. I’ll take care of that next by creating a word_analyzer.rb file, defining the class…*

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文