dmarkow / jquery-mobile-rails

jQuery Mobile for Rails 3/4 Asset Pipeline
MIT License
167 stars 49 forks source link

AssetsError on Rails 4.1 #36

Closed denisw closed 10 years ago

denisw commented 10 years ago

Trying to use this gem with Rails 4.1 yields this error:

Asset filtered out and will not be served: add `Rails.application.config.assets.precompile += %w( jquery-mobile/icons-png/action-white.png )` to `config/initializers/assets.rb` and restart your server

This is because Sprokets now does additional sanity checks to make sure that the assets configuration works with precompiled assets in production; see rails/sprockets-rails#84. For this reason, the jquery_mobile_rails gem should probably make sure that all of its assets are listed in Rails.application.config.assets.precompile.

dmarkow commented 10 years ago

I'll do some testing soon to make sure JQM works fine with precompiled assets in production and push out a new version.

dmarkow commented 10 years ago

While I work on looking into automating/verifying this, I added a note to the README saying to add this line in config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w( jquery-mobile/icons-png/*.png jquery-mobile/*.gif )
dmarkow commented 10 years ago

Ok, it looks like it was as easy as adding an initializer entry to engine.rb to add this gem's assets to the pipeline. Released v1.4.4.1: I tried it out on a blank Rails 4.1.6 app -- runs fine in development mode now and all of the PNG/GIF files get added during precompilation.

Please let me know if you continue to see the issue. Thanks for reporting it!