Ruby 2.1,Rails 4.1.4,刚刚集成了Resque的主分支(包含了Resque 2.0的工作)显然,网络界面有一个新的宝石,Resque web。
不幸的是,当我转到Web界面时,会出现以下错误:
undefined method `workers' for Resque:Module
Extracted source (around line #1):
<h1 class="wi"><%= worker_jobs.size %> of <%= workers.size %> Workers Working</h1>
<p class="intro">The list below contains all workers which are currently running a job.</p>
<table class="table table-bordered workers">
<tr>
在我的gemfile中,我会:
gem 'resque-web', require: 'resque_web'
我已经安装了redis并且运行了一个redis服务器在我的路线中。rb,我
require 'resque_web'
在我的实际路线上mount ResqueWeb::Engine => "/resque_web"
我也试过管理工人,但我认为这也不能解决问题。
下面是堆栈跟踪:
resque-web (0.0.6) app/helpers/resque_web/working_helper.rb:4:in `workers'
resque-web (0.0.6) app/helpers/resque_web/working_helper.rb:12:in `worker_jobs'
resque-web (0.0.6) app/views/resque_web/working/_working.html.erb:1:in `___sers__avid__rbenv_versions_______lib_ruby_gems_______gems_resque_web_______app_views_resque_web_working__working_html_erb___4177816445361536411_70337550467320'
actionview (4.1.4) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:143:in `render'
actionview (4.1.4) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionview (4.1.4) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.4) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionview (4.1.4) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.1.4) lib/action_view/helpers/rendering_helper.rb:35:in `render'
haml (4.0.5) lib/haml/helpers/action_view_mods.rb:12:in `render_with_haml'
resque-web (0.0.6) app/views/resque_web/overview/show.html.erb:3:in `___sers__avid__rbenv_versions_______lib_ruby_gems_______gems_resque_web_______app_views_resque_web_overview_show_html_erb__2964728264206778935_70337550244520'
actionview (4.1.4) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:143:in `render'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:55:in `block (2 levels) in render_template'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:54:in `block in render_template'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionview (4.1.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.1.4) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.1.4) lib/action_view/rendering.rb:99:in `_render_template'
actionpack (4.1.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.1.4) lib/action_view/rendering.rb:82:in `render_to_body'
actionpack (4.1.4) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.1.4) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.4) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.1.4) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.1.4) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/David/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
activesupport (4.1.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:40:in `render'
resque-web (0.0.6) app/controllers/resque_web/overview_controller.rb:4:in `show'
actionpack (4.1.4) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.4) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.4) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.4) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.4) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.4) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.4) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in `call'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in `call'
railties (4.1.4) lib/rails/engine.rb:514:in `call'
railties (4.1.4) lib/rails/railtie.rb:194:in `public_send'
railties (4.1.4) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in `call'
newrelic_rpm (3.8.1.221) lib/new_relic/rack/error_collector.rb:55:in `call'
newrelic_rpm (3.8.1.221) lib/new_relic/rack/agent_hooks.rb:32:in `call'
newrelic_rpm (3.8.1.221) lib/new_relic/rack/browser_monitoring.rb:27:in `call'
newrelic_rpm (3.8.1.221) lib/new_relic/rack/developer_mode.rb:45:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.4) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.4) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.4) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.4) lib/rails/engine.rb:514:in `call'
railties (4.1.4) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/David/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
/Users/David/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
/Users/David/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
有人知道我遗漏了什么吗也许现在尝试将resque 2.0与resque web结合使用还为时过早…?
最佳答案
您可以使用resque web的resque-2
分支来解决这个问题。您可以在Gemfile中设置分支
gem 'resque-web', git: 'https://github.com/resque/resque-web.git', branch: 'resque-2'
然后运行bundle安装
bundle install
重新启动Rails应用程序后,您将能够访问
/resque_web
。resque-2
分支上resque web的README有更多关于resque web和resque 2.0的信息。关于ruby-on-rails - Resque Web界面不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25733375/