Disabling asset pooling in production, Rails 3.1?

I have an existing Rails application that I am upgrading to Rails 3.1 from Rails 3.0. Everything is going well in development, but when I switch to production, my style sheets break, apparently due to compilation of assets.

I would like to disable compilation of assets during production until I can get conflicts in the style sheets, but the configuration switches that I throw at it don't seem to work.

production.rb

# Don't fallback to assets pipeline config.assets.compile = false # Do not compress assets config.assets.compress = false # Generate digests for assets URLs config.assets.digest = false 

After restarting Passenger application.css is the only stylesheet that contains embedded content. In the development environment, I have:

development.rb

 # Do not compress assets config.assets.compress = false # Expands the lines which load the assets config.assets.debug = true 

..., which leads to loading several loadable stylesheets, not just application.css and working styles in the application.

application.rb

 =stylesheet_link_tag 'application' =javascript_include_tag 'application' 

application.css

 *= require flutie *= require_self *= require jquery-ui-1.8.14.custom.css *= require demo_table 

All assets are configured in the application / assets

+7
source share
1 answer

In your application.rb application you need to disable it. If you want it to be as in production only , leave it as true in your .rb application and just put config.assets.enabled = false in the production.rb file

 # Enable the asset pipeline config.assets.enabled = false 
+6
source

All Articles