Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The asset "logo.png" is not present in the asset pipeline

In Rails 5.1.3 I change logo file in app/assets/images Then error don't know what to fix. Any one know ?

The asset "logo.png" is not present in the asset pipeline. 

Already try restart rails, rails clean, rails or rails assets:precompile

Here my config/initializers/assets.rb

# Be sure to restart your server when you modify this file.  # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0'  # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path # Add Yarn node_modules folder to the asset load path. Rails.application.config.assets.paths << Rails.root.join('node_modules')  # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in the app/assets # folder are already added. # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 
like image 404
PKul Avatar asked Sep 03 '17 06:09

PKul


People also ask

What is an asset pipeline?

1 What is the Asset Pipeline? The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass, and ERB.

How do you Precompile an asset?

To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.

What are assets in Rails?

Generally asset is anything that browser loads after it gets the HTML page. Meaning javascript, css and any images. But as you pointed out there are two different image types in a rails project.

What does rake assets Clean do?

The clean it removes the old versions of the precompiled assets while leaving the new assets in place. Show activity on this post. rake assets:clean removes compiled assets. It is run by cap deploy:assets:clean to remove compiled assets, generally from a remote server.


1 Answers

I had a similar problem. The solution was to add the file extension on the image.

= image_tag 'logo', alt: '' 

to

= image_tag 'logo.jpg', alt: '' 
like image 200
Abdullah Avatar answered Oct 02 '22 03:10

Abdullah