ファイルが空の場合でも、拡張子が scss のファイルをインポートするとエラーが発生します。しかし、その空のファイルの拡張子をcssに変更すると、うまくいきます!!!
ブートストラップからのドロップダウンが機能していなかったため、レールのバージョンを 3.2.3 から 3.2.15 に変更すると、すべてが起こり始めました。
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 assets: precompile はエラーなしで終了します。
EMPTY scss ファイルをインポートしようとすると、拡張子がscssであるという事実 (と思う) だけでは機能しません。
不足している構成はありますか? 主な理由は、レールをバージョン 3.2.3 から 3.2.15 に変更したためです。