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

Not working on production #18

Closed
heidiv opened this issue Mar 21, 2016 · 3 comments · Fixed by #19
Closed

Not working on production #18

heidiv opened this issue Mar 21, 2016 · 3 comments · Fixed by #19

Comments

@heidiv
Copy link

heidiv commented Mar 21, 2016

Hello! I'm sure this is something on my end, not yours, but I was wondering if you had any insight as to why retina_tag would work beautifully on my local development environment, but not my production server?

On the server, data-hidpi-src & data-lowdpi-src attributes are not being added to tags. I checked my public/assets dir and the @2x versions are there. The retina_tag gem is installed. Other thoughts? Thanks in advance!

@RustComet
Copy link

I am also having this issue. I have used the gem before on other projects, but it seems to be broken on my latest.

rails 4.2.5
ruby 2.3.0

@davydotcom
Copy link
Owner

Ill have to see what might have changed in latest rails to cause this.

@naps62
Copy link
Contributor

naps62 commented May 19, 2016

Here's the cause of the issue: 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)

You can get the same info using Rails.application.assets_manifest, although you have to basically implement the find_asset logic yourself

I'm trying to fix this myself right now, since I need to fix this for my current project.
I'll submit a PR if I'm successful

mackinleysmith added a commit to mackinleysmith/retina_tag that referenced this issue Jun 11, 2016
Fix asset discovery and handling to account for assets manifest, which
fixes compatibility with Rails 4 default production configuration,
namely `config.assets.compile = false`.

Fixes davydotcom#18
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 a pull request may close this issue.

4 participants