错误:导入的文件未找到或不可读.仅限scss文件

JGu*_*ezC 1 rake ruby-on-rails sass heroku asset-pipeline

即使文件为空,我也有错误导入扩展名为scss的文件.但是,如果我将该空文件的扩展名更改为css,那就行了!

当我将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
Run Code Online (Sandbox Code Playgroud)

如果我跑

bundle exec rake assets:precompile
Run Code Online (Sandbox Code Playgroud)

它会抛出同样的错误

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?'
....
....
Run Code Online (Sandbox Code Playgroud)

正如我之前所说,如果我将文件custom.scss更改为custom.css,则捆绑exec rake资产:预编译结束且没有错误.

如果我尝试导入EMPTY scss文件,它将不会仅由(我认为)扩展名为scss的事实起作用.

有没有我缺少的配置?主要是因为我将版本从3.2.3更改为3.2.15

JGu*_*ezC 5

在到处游荡之后,bootstrap-sass github存储库中的某个人向我指出了正确的方向.

我不得不将application.css重命名为application.scss.

这就是诀窍!