mattgibson / resque-scheduler-web

Tabs in the Resque Web gem for the Resque Scheduler plugin.
https://rubygems.org/gems/resque-scheduler-web
MIT License
25 stars 24 forks source link

NoMethodError: undefined method `find_asset' for nil:NilClass #5

Closed jtmarmon closed 8 years ago

jtmarmon commented 8 years ago

When trying to load /resque_web with rails 4.2.5, I get the following exception:

NoMethodError: undefined method `find_asset' for nil:NilClass
1
File "/app/vendor/bundle/ruby/2.2.0/gems/resque-web-0.0.7/app/views/layouts/resque_web/application.html.erb" line 12 in block in _vendor_bundle_ruby_______gems_resque_web_______app_views_layouts_resque_web_application_html_erb___4084463186552865067_69824662505420
2
File "/app/vendor/bundle/ruby/2.2.0/gems/resque-web-0.0.7/app/views/layouts/resque_web/application.html.erb" line 11 in collect
3
File "/app/vendor/bundle/ruby/2.2.0/gems/resque-web-0.0.7/app/views/layouts/resque_web/application.html.erb" line 11 in _vendor_bundle_ruby_______gems_resque_web_______app_views_layouts_resque_web_application_html_erb___4084463186552865067_69824662505420
4
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/template.rb" line 145 in block in render
5
File "/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb" line 166 in instrument
6
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/template.rb" line 333 in instrument
7
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/template.rb" line 143 in render
8
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb" line 66 in render_with_layout
9
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb" line 52 in render_template
10
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb" line 14 in render
11
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/renderer.rb" line 42 in render_template

Now, this seems like an issue with resque-web, and not this gem, but if I remove resque-scheduler-web the page loads just fine. Any ideas?

mattgibson commented 8 years ago

Thanks for opening the issue. Not seen that before. Could be an update to resque-web has changed something. I'll take a look.

mattgibson commented 8 years ago

Looks like it might be this: https://stackoverflow.com/questions/35154588/rails-sprockets-3-0-find-asset

jtmarmon commented 8 years ago

Yeah I saw that issue as well. I'm a little confused of why installing resque-scheduler-web triggers this issue though, since the code is their with or without r-s-w

mattgibson commented 8 years ago

OK, I have a possible fix. The issue is that resque-web is looping through each plugin trying to include its stylesheets. This appears to be failing because you are using a version of sprockets where the find_assets method is no longer there.

Try adding this to your gemfile and see if it works:

gem 'resque-web', github: 'mattgibson/resque-web', branch: 'fix-sprockets-manifest-error'
mattgibson commented 8 years ago

It's not an issue without the plugin as the loop is never called (number of plugins = 0)

jtmarmon commented 8 years ago

yep that did the trick!

mattgibson commented 8 years ago

Sweet! I'll make a PR for the resque-web gem.

jtmarmon commented 8 years ago

thanks a bunch :D

mattgibson commented 8 years ago

The upstream fix is merged now and I've released version 1.0.0 which depends on it, so this shouldn't be a problem any more. Thanks again for the bug report!