在 Rails 5.1.3 中
我更改应用程序/资产/图像中的徽标文件
然后错误不知道要修复什么。有谁知道吗?
The asset "logo.png" is not present in the asset pipeline.
已经尝试重新启动rails、rails clean、rails或rails asset:precompile
这是我的 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 )
我有类似的问题。解决方案是在图像上添加文件扩展名。
= image_tag 'logo', alt: ''
to
= image_tag 'logo.jpg', alt: ''
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)