我是ruby on rails的新手,目前正在关注Michael Hartl的教程,不幸的是当我尝试@import "bootstrap";
在custom.css.scss文件中调用时,第五章陷入困境.
我收到以下错误:
Sprockets::Rails::Helper::AssetFilteredError in StaticPages#home Showing /Users/name/Documents/Rails_projects/sample_app/app/views/layouts /application.html.erb where line #5 raised: Asset filtered out and will not be served: add `Rails.application.config.assets.precompile += %w( glyphicons-halflings.png )` to `config/initializers/assets.rb` and restart your server (in /Users/name/Documents/Rails_projects/sample_app/app/assets/styleshee /custom.css.scss) Extracted source (around line #5): line 5: stylesheet_link_tag "application", media: "all"
梳理了互联网后,我尝试了以下解决方案,其中没有一个有效
上面提供的assets.rb文件的建议
使用control + c重新启动服务器
将gem文件'bootrap-sass'移动到gem文件中的部分,以获取产品中不需要的资产
将application.css文件的扩展名更改为application.css.scss
直接调用@import"bootstrap"; 在application.css.scss文件中
添加到config.ru以下内容:require'bootstrap-sass'#requirest of bootstrap-sass
这些都是我在网上找到的解决方案,但都没有.
感谢任何帮助!
谢谢!