resque: Resque fails to load assets when run on Rails 3.1
Hi, I’ve added
mount Resque::Server, :at => '/resque-admin'
to my routes.rb, it works nice on development, but fails to load images/stylesheets/javascripts on production and when (via view source) I click on https://…/resque-admin/reset.css it shows weird Routing error with message:
No route matches [GET] “/opt/ruby-enterprise-1.8.7-2010.03/lib/ruby/gems/1.8/gems/resque-1.19.0/lib/resque/server/public/reset.css”
I know that Rails 3.1 has asset pipeline, but since this is standalone sinatra app it shouldn’t matter, right? Is it my fault or whats going on? Any hints welcome 😃
Env: Ruby EE 2010.03 Resque 1.19.0 Rails 3.1.0
production.rb:
config.serve_static_assets = false
config.assets.digest = true
About this issue
- Original URL
- State: closed
- Created 13 years ago
- Comments: 52 (7 by maintainers)
I went back over this and kind of sidestepped it in nginx with the following:
IOW, taking resque out of the equation for nginx asset configuration. It’s an improvement, in that it avoids maintenance issues should resque update its web assets, since the gem assets are used with this configuration.
The problem is that resque’s assets and “pages” are being served from the same directory, which makes configuring this case a little tricky. If you add
resqueto the list of directories inlocationabove, then resque 404s, because nginx can’t find the “file”, sayhttp://example.com/resque/queues.Above, @mtoledo says:
Well, I tried that, but every incantation I tried failed to work. I tried, such as:
So, could someone provide a nginx
locationclause that works, please.It would be great to have a wiki page for these correct/suggested configuration.