即使文件爲空,我也有錯誤導入擴展名爲scss的文件。但是,如果我將該空文件的擴展名更改爲css,那麼它會工作!錯誤:要導入的文件未找到或無法讀取。僅適用於scss文件
當我將rails版本從3.2.3更改爲3.2.15時,一切都開始發生,因爲從bootstrap下拉不起作用。
我沒有問題運行我的rails s命令。但是當我嘗試推向Heroku時,它會拋出錯誤:
要導入的文件未找到或無法讀取:custom.scss。
這是我application.css文件:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
@import "custom.scss"; //or any file with extension .scss it throws error
,如果我跑
bundle exec rake assets:precompile
它拋出了同樣的錯誤
File to import not found or unreadable: custom.scss.
Load paths:
c:/Users/jgutierrezco/RubyWorkspace/sample_app_test
c:/Users/jgutierrezco/RubyWorkspace/vendor/assets/stylesheets
(in c:/Users/jgutierrezco/RubyWorkspace/sample_app_test/app/assets/stylesheets/application.css)
(sass):15
C:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:67:in `rescue in import'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:45:in `import'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:28:in `imported_file'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:37:in `css_import?'
....
....
正如我以前說過,如果我將文件custom.scss更改爲custom.css bundle exec rake資產:預編譯結束時沒有錯誤。
如果我嘗試導入一個EMPTY scss文件,它將無法正常工作(我認爲)擴展名爲scss。
有沒有我失蹤的配置?主要是因爲我改變了從3.2.3版本到3.2.15的版本
你試過沒有擴展名? – Shipow