Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing for sprockets 3 in production #19

Merged
merged 2 commits into from
Jun 13, 2016

Conversation

naps62
Copy link
Contributor

@naps62 naps62 commented May 19, 2016

Fixes #18

A recent sprockets update changed some internals, which prevented this gem from working in production

This sprockets-rails issue describes the actual error that caused this: rails/sprockets-rails#237
In production, Rails.application.assets is only set if config.assets.compile is enabled (and it's not enabled by default in production)

This fix worked for my. I'm not sure if it works as a global solution, but I supose it should

One thing still remains in the codebase which I did not fix: the whole problematic code is surrounded by a begin/rescue, which completely silences any errors within it, which made it harder to spot the problem in the first place, and will make it harder to see if it's working again

I'm not sure why it was originally put there, but I didn't remove it (although we probably should, it's a very big smell)

@naps62
Copy link
Contributor Author

naps62 commented Jun 13, 2016

This was previously not working. because of the empty begin/rescue in there it took me a while to notice and fix the error

But as of today it's working again, and being used by my company in production.

@davydotcom can you take a look?

@davydotcom davydotcom merged commit 2da1897 into davydotcom:master Jun 13, 2016
@davydotcom
Copy link
Owner

Awesome thanks! I'll get this released

@heidiv
Copy link

heidiv commented Jul 14, 2016

hello, just wondering if this has been updated on rubygems? Thanks!

@naps62
Copy link
Contributor Author

naps62 commented Jul 14, 2016

@heidiv seems not. The last update on rubygems was in April.
Would be nice do so, though

@heidiv
Copy link

heidiv commented Jul 17, 2016

@naps62 April 2014?! I tried to reference this repo in my Gemfile but got permission denied. Suggestions for getting the latest? Would prefer not to copy the code into my proj but perhaps that's what's needed.

@naps62
Copy link
Contributor Author

naps62 commented Jul 18, 2016

Uh! I didn't even notice it was 2014...

How are you referencing the repo in your Gemfile? This should work:

gem "retina_tag", github: "davydotcom/retina_tag", ref: "2da1897"

The ref argument is optional, but it's a good practice to make sure you don't end up getting surprise updates

@davydotcom
Copy link
Owner

released 1.4.1 with the fixes, thanks!

@heidiv
Copy link

heidiv commented Jul 26, 2016

Thanks @davydotcom !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not working on production
3 participants