Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Janfred opened this issue Dec 26, 2017 · 7 comments
Open

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

Janfred opened this issue Dec 26, 2017 · 7 comments

Comments

@Janfred
Copy link

Janfred commented Dec 26, 2017

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
Copy link

boourns commented Feb 18, 2018

It's a rails 5.1 change that is documented here rails/rails#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
Copy link
Author

Janfred commented Feb 20, 2018

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
Copy link

try to create these PNGs files...

@Janfred
Copy link
Author

Janfred commented Aug 28, 2019

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

@calebhaye
Copy link

This is still a problem with Rails 6 :(

@khalilFrough
Copy link

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
Copy link

this problem still persists in rails 7

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

No branches or pull requests

6 participants