ericallam / font_assets

Helps with serving font assets with Rails 3.1
137 stars 79 forks source link

Not compatible with 'mount Resque::Server' in routes #21

Closed rochers closed 10 years ago

rochers commented 10 years ago

I am getting a hard Rack error when I try to access my resque web interface:


NoMethodError at /resque/web undefined method `split' for nil:NilClass

Ruby /Users/rocher/.rvm/gems/ruby-2.1.0/gems/font_assets-0.1.10/lib/font_assets/middleware.rb: in extension, line 61 Web GET localhost.dev/resque/web Jump to: GETPOSTCookiesENV Traceback (innermost first)

/Users/rocher/.rvm/gems/ruby-2.1.0/gems/font_assets-0.1.10/lib/font_assets/middleware.rb: in extension "." + path.split("?").first.split(".").last... /Users/rocher/.rvm/gems/ruby-2.1.0/gems/font_assets-0.1.10/lib/font_assets/middleware.rb: in set_headers! if ext = extension(path) and font_asset?(ext)...


The line in my routes.rb is: mount Resque::Server, at: '/resque/web'

Any thoughts on a workaround / root cause or should I fork and fix?

jjb commented 10 years ago

had the same problem: https://github.com/mperham/sidekiq/issues/1514

@gaganawhad has a fix here: https://github.com/ericallam/font_assets/pull/17

in the comments there, @ericallam says that another commit may have fixed it already

ericallam commented 10 years ago

Could you test out 01861d9bba163a4e7af0cac8760067624e0a9ca0 and see if that fixes the problem?

jjb commented 10 years ago

01861d9bba163a4e7af0cac8760067624e0a9ca0 works!

ericallam commented 10 years ago

Just cut v0.1.11 gem with this fix. Thanks for checking that out for me!

gaganawhad commented 10 years ago

Awesome :+1: