Compass / compass-rails

compass rails integration
MIT License
591 stars 276 forks source link

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

Closed timhaines closed 8 years ago

timhaines commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

I just cut 3.0.1, thanks for the pull request.