{"action":"created","issue":{"url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/145","repository_url":"https://api.github.com/repos/fphilipe/premailer-rails","labels_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/145/comments","events_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/145/events","html_url":"https://github.com/fphilipe/premailer-rails/issues/145","id":123045124,"number":145,"title":"undefined method `find_asset' for nil:NilClass in asset_pipeline_loader","user":{"login":"javierjulio","id":198547,"avatar_url":"https://avatars.githubusercontent.com/u/198547?v=3","gravatar_id":"","url":"https://api.github.com/users/javierjulio","html_url":"https://github.com/javierjulio","followers_url":"https://api.github.com/users/javierjulio/followers","following_url":"https://api.github.com/users/javierjulio/following{/other_user}","gists_url":"https://api.github.com/users/javierjulio/gists{/gist_id}","starred_url":"https://api.github.com/users/javierjulio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javierjulio/subscriptions","organizations_url":"https://api.github.com/users/javierjulio/orgs","repos_url":"https://api.github.com/users/javierjulio/repos","events_url":"https://api.github.com/users/javierjulio/events{/privacy}","received_events_url":"https://api.github.com/users/javierjulio/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-12-18T23:48:46Z","updated_at":"2016-06-14T07:08:34Z","closed_at":"2016-06-11T21:15:22Z","body":"Today I updated the sprockets-rails gem which is now at 3.0.0 and noticed an error occurring after updating: \"NoMethodError·undefined method `find_asset' for nil:NilClass\". I'm using latest premailer-rails 1.8.2. The error is is happening here: https://github.com/fphilipe/premailer-rails/blob/master/lib/premailer/rails/css_loaders/asset_pipeline_loader.rb#L10\r\n\r\nNoticed the issue reported on sprockets-rails https://github.com/rails/sprockets-rails/issues/237 back in April for the 3.0 version. I didn't see what the fix was but it was mentioned that it was resolved in react-rails. I figure the same issue that happened there is probably happening here."},"comment":{"url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/comments/225797343","html_url":"https://github.com/fphilipe/premailer-rails/issues/145#issuecomment-225797343","issue_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/145","id":225797343,"user":{"login":"fphilipe","id":128151,"avatar_url":"https://avatars.githubusercontent.com/u/128151?v=3","gravatar_id":"","url":"https://api.github.com/users/fphilipe","html_url":"https://github.com/fphilipe","followers_url":"https://api.github.com/users/fphilipe/followers","following_url":"https://api.github.com/users/fphilipe/following{/other_user}","gists_url":"https://api.github.com/users/fphilipe/gists{/gist_id}","starred_url":"https://api.github.com/users/fphilipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fphilipe/subscriptions","organizations_url":"https://api.github.com/users/fphilipe/orgs","repos_url":"https://api.github.com/users/fphilipe/repos","events_url":"https://api.github.com/users/fphilipe/events{/privacy}","received_events_url":"https://api.github.com/users/fphilipe/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T07:08:34Z","updated_at":"2016-06-14T07:08:34Z","body":"@javierjulio I don't follow.\r\n\r\nAs far as I can tell, in development it will pick up the asset from the asset pipeline.\r\n\r\nIn production the asset pipeline won't be available ([this](https://github.com/fphilipe/premailer-rails/blob/cd21bbb325790289dc3ac49b05ba178e9cc11839/lib/premailer/rails/css_loaders/asset_pipeline_loader.rb#L15-L19) will be `nil`) and thus, it will look for the compiled asset in `public/`. Since rails' `stylesheet_link_tag` will output something like `http://www.example.com/assets/email-fingerprint.css`, it will look for `public/assets/email-fingerprint.css`. If it can't find that (e.g. when you don't have the compiled assets in the app, but on a CDN), it will request `http://www.example.com/assets/email-fingerprint.css`.\r\n\r\nAre you using the asset pipeline in production?"}}
{"actor":{"display_login":"fphilipe"}}