{"action":"closed","issue":{"url":"https://api.github.com/repos/mperham/sidekiq/issues/2728","labels_url":"https://api.github.com/repos/mperham/sidekiq/issues/2728/labels{/name}","comments_url":"https://api.github.com/repos/mperham/sidekiq/issues/2728/comments","events_url":"https://api.github.com/repos/mperham/sidekiq/issues/2728/events","html_url":"https://github.com/mperham/sidekiq/issues/2728","id":123250354,"number":2728,"title":"Sidekiq web UI load order","user":{"login":"SamMolokanov","id":4699081,"avatar_url":"https://avatars.githubusercontent.com/u/4699081?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMolokanov","html_url":"https://github.com/SamMolokanov","followers_url":"https://api.github.com/users/SamMolokanov/followers","following_url":"https://api.github.com/users/SamMolokanov/following{/other_user}","gists_url":"https://api.github.com/users/SamMolokanov/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMolokanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMolokanov/subscriptions","organizations_url":"https://api.github.com/users/SamMolokanov/orgs","repos_url":"https://api.github.com/users/SamMolokanov/repos","events_url":"https://api.github.com/users/SamMolokanov/events{/privacy}","received_events_url":"https://api.github.com/users/SamMolokanov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-21T10:24:31Z","updated_at":"2015-12-21T15:46:39Z","closed_at":"2015-12-21T15:46:39Z","body":"We got a little problem with mounting Sidekiq web UI in Rails application and using Rack middleware `Sidekiq::Rack::BatchStatus` from pro version in `config/application.rb`\r\n\r\nBacktrace:\r\n\r\n```\r\n/Users/sam/.rvm/gems/ruby-2.2.3@rails4/gems/sidekiq-3.5.3/lib/sidekiq/web.rb:15:in `<class:Web>': uninitialized constant Sidekiq::Rack::Protection (NameError)\r\n\tfrom /Users/sam/.rvm/gems/ruby-2.2.3@rails4/gems/sidekiq-3.5.3/lib/sidekiq/web.rb:11:in `<module:Sidekiq>'\r\n\tfrom /Users/sam/.rvm/gems/ruby-2.2.3@rails4/gems/sidekiq-3.5.3/lib/sidekiq/web.rb:10:in `<top (required)>'\r\n\tfrom /Users/sam/work/test_sidekiq/config/routes.rb:2:in `block in <top (required)>'\r\n\tfrom /Users/sam/.rvm/gems/ruby-2.2.3@rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/route_set.rb:337:in `instance_exec'\r\n\tfrom /Users/sam/.rvm/gems/ruby-2.2.3@rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/route_set.rb:337:in `eval_block'\r\n\tfrom /Users/sam/.rvm/gems/ruby-2.2.3@rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/route_set.rb:315:in `draw'\r\n\tfrom /Users/sam/work/test_sidekiq/config/routes.rb:1:in `<top (required)>'\r\n```\r\n\r\nGemfile:\r\n```\r\ngem 'sidekiq', '< 4'\r\ngem 'sidekiq-pro', source: 'https://*****'\r\ngem 'sinatra', :require => nil\r\n```\r\n\r\nconfig/application.rb\r\n\r\n```\r\nrequire \"sidekiq/rack/batch_status\"\r\n\r\nmodule TestSidekiq\r\n  class Application < Rails::Application\r\n    config.middleware.use Sidekiq::Rack::BatchStatus\r\n  end\r\nend\r\n```\r\n\r\nconfig/routes.rb\r\n```\r\n  require 'sidekiq/web'\r\n  require 'sidekiq/pro/web'\r\n  mount Sidekiq::Web => '/sidekiq'\r\n```\r\n\r\nrails -v\r\n`Rails 4.0.13`\r\nruby -v\r\n`ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]`\r\n\r\nProblem caused by load order and if we add  `use Sidekiq::Rack::BatchStatus` in `config.ru` everything is fine."}}