seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 996 forks source link

Problem with Rails 5.1.4 and apple-touch-icons asset pipeline #928

Open Janfred opened 6 years ago

Janfred commented 6 years ago

I've encountered problems with the default layout since I've upgraded to Rails 5.1.4

I see the following error:

ActionView::Template::Error (The asset "apple-touch-icon-144x144-precomposed.png" is not present in the asset pipeline.):
    11: 
    12:     <!-- For third-generation iPad with high-resolution Retina display: -->
    13:     <!-- Size should be 144 x 144 pixels -->
    14:     <%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>
    15: 
    16:     <!-- For iPhone with high-resolution Retina display: -->
    17:     <!-- Size should be 114 x 114 pixels -->

app/views/layouts/application.html.erb:14:in `_app_views_layouts_application_html_erb__3925031818673559404_47451698147320'

I've setup the test app using this commands:

rails new BoostrapTest
cd BootstrapTest
rails generate bootstrap:install
rails generate bootstrap:layout
# Add //= require bootstrap in app/assets/javascript/application.js
# Add  *= bootstrap_and_overrides in app/assets/stylesheets/application.css
rails generate scaffold User username:string password:string
rails generate bootstrap:themed Users
rails s

And then go to http://localhost:3000/users

In Rails 5.0.X the same setup works but already shows a deprecation hint. (Don't know the exact version, could look for it if needed)

boourns commented 6 years ago

It's a rails 5.1 change that is documented here https://github.com/rails/rails/issues/29535

you revert to the original behaviour by adding

Rails.application.config.assets.unknown_asset_fallback = true

to a file in config/initializers (like, say, config/initializers/assets.rb)

edit: I guess this solution isn't perfect since the log now shows

DEPRECATION WARNING: The asset "apple-touch-icon-114x114-precomposed.png" is not present in the asset pipeline.Falling back to an asset that may be in the public folder.
This behavior is deprecated and will be removed.
To bypass the asset pipeline and preserve this behavior,
use the `skip_pipeline: true` option.

Following that instructions and adding skip_pipeline: true to the favicon_link_tag entries in your layout also seem to work, and suppresses the deprecation warning.

Janfred commented 6 years ago

Since the behavior will be removed I guess it needs to be addressed. For the moment there should be at least some kind of documentation which adjustments have to be made when using this gem with Rails 5.

fagianijunior commented 6 years ago

try to create these PNGs files...

Janfred commented 5 years ago

Any progress on this issue? The issue still exists with the current version of this gem and rails 5.2.3.

calebhaye commented 4 years ago

This is still a problem with Rails 6 :(

khalilFrough commented 4 years ago

any updates on this, still issue in rails 6 :( I am trying to learn each time I am learning new things i face new problems :(

TrindadeF commented 2 years ago

this problem still persists in rails 7