Skip to content

Fix assets:precompile in Production mode when using Sprockets 3.#263

Merged
craigmcnamara merged 4 commits intoCompass:masterfrom
timhaines:production-mode
Feb 15, 2016
Merged

Fix assets:precompile in Production mode when using Sprockets 3.#263
craigmcnamara merged 4 commits intoCompass:masterfrom
timhaines:production-mode

Conversation

@timhaines
Copy link
Copy Markdown
Contributor

The sprockets 3.0 gem has changed such that Rails.application.assets is nil in production mode (due to config.assets.compile being set to false). This means rake assets:precompile no longer works in a production environment.

This PR changes compass-rails so it generates the sprockets environment if it finds Rails.application.assets to be nil.

It also adds a test to ensure that precompiling runs correctly when config.assets.compile = false.

@timhaines
Copy link
Copy Markdown
Contributor Author

@craigmcnamara I've added a test here, and updated the changelog and version. It'd be great to see this merged and a new gem released. Let me know if I can do anything else? cc: @mvastola

Fixes #257

craigmcnamara added a commit that referenced this pull request Feb 15, 2016
Fix assets:precompile in Production mode when using Sprockets 3.
@craigmcnamara craigmcnamara merged commit 47db9cb into Compass:master Feb 15, 2016
@craigmcnamara
Copy link
Copy Markdown
Member

I just cut 3.0.1, thanks for the pull request.

dennmart added a commit to dennmart/react-rails that referenced this pull request Sep 12, 2017
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.

2 participants