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

Asset compilation doesn't appear to add fingerprints #10551

Closed
Floppy opened this issue May 10, 2013 · 7 comments
Closed

Asset compilation doesn't appear to add fingerprints #10551

Floppy opened this issue May 10, 2013 · 7 comments

Comments

@Floppy
Copy link
Contributor

Floppy commented May 10, 2013

On Rails 4.0.0-rc1, asset precompilation doesn't seem to add the fingerprints to asset paths in the compiled CSS.

I'd expect it to reference the fingerprinted version at assets/checker-b7e280146cd5db817134e79696b7ca07.png, which has been generated by the precompilation step. The precompilation doesn't generate a non-fingerprinted version of the image file in the public/assets directory, which would be required for the CSS to work.

Am I misunderstanding, or doing something stupid, or is this a bug? This was the default out-of-the-box behaviour, with as little code changed as possible.

@Floppy
Copy link
Contributor Author

Floppy commented May 10, 2013

This may be related to rails/sass-rails#152

@guilleiguaran
Copy link
Member

RAILS_ENV=production rake assets:precompile

@Floppy
Copy link
Contributor Author

Floppy commented May 10, 2013

Ah, yes, running assets:precompile in RAILS_ENV=production works. This still seems like a bug, as it should be consistent whichever environment you are in.

@steveklabnik
Copy link
Member

Nope, you're supposed to only compile in production now.

@Floppy
Copy link
Contributor Author

Floppy commented May 10, 2013

In which case it should fail with a useful error message, rather than silently producing the wrong thing. I seriously doubt I'll be the last person caught by this.

@Floppy
Copy link
Contributor Author

Floppy commented May 10, 2013

I've done a PR on sprockets-rails with a warning message. Maybe this will help someone.

@joliss
Copy link
Contributor

joliss commented Feb 2, 2014

I'm the maintainer of the jquery-ui-rails gem, and I just spent 30 minutes tracking this down because somebody had reported an issue on jquery-ui-rails -- only to discover that it's a weird problem with how Rails requires you to explicitly set the environment.

Because of that, I'd like to second the request that Rails at least handle this more gracefully. It seems it would cause less work for all of us.

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

No branches or pull requests

4 participants