简体   繁体   English

Bower,Bootstrap和sass-rails gem,错误:“找不到导入文件或不可读:bootstrap”

[英]Bower, Bootstrap and sass-rails gem, error: “File to import not found or unreadable: bootstrap”

In short I am trying to find out why I get the error: 简而言之,我试图找出导致错误的原因:

File to import not found or unreadable: bootstrap

This is the full description: 这是完整的描述:

1) I am managing my Javascript libraries using Bower, so I put bootstrap dependency inside the bower.js: 1)我正在使用Bower管理我的Javascript库,因此我将bootstrap依赖项放入bower.js中:

   ... 
   "dependencies": {
    "bootstrap": "~3"
    }
   ...

and I inserted in application.rb 我插入了application.rb

config.assets.paths << Rails.root.join('vendor', 'assets', 'components')

2) Rails4 is using the gem 'sass-rails' to manage Sass: 2)Rails4使用gem'sass-rails'管理Sass:

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'

3) I also added 3)我还加了

@import "bootstrap";

.field_with_errors {
  @extend .has-error;
}

to make bootstrapt-compatible with the rails-forms (see https://gorails.com/blog/trying-out-bootstrap-3-0 ) 使Bootstrapt与rails-forms兼容(请参阅https://gorails.com/blog/trying-out-bootstrap-3-0


What I get is the error: 我得到的是错误:

File to import not found or unreadable: bootstrap. 找不到或不可读的导入文件:引导程序。

Apart from the specific error, It would be really appreciate an explanation about Bower and sass-rails can collaborate together without problem (I didn't find any good resource on the web). 除了特定的错误之外,我们非常感谢您提供有关Bowersass-rails可以毫无问题地协作的说明(我在网络上找不到任何好的资源)。

Open your /assets/stylesheets/application.css file and add the following line: 打开/assets/stylesheets/application.css文件并添加以下行:

*= require bootstrap-sass-official/assets/stylesheets/bootstrap.scss

The application.css file must contain the directives which indicate which resources should be loaded by your application. application.css文件必须包含指示您的应用程序应该加载哪些资源的指令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 要导入的文件未找到或无法读取:bootstrap(Bootstrap、Rails、Sass 错误) - File to import not found or unreadable: bootstrap (Bootstrap, Rails, Sass error) Ruby on Rails-导入Bootstrap错误“找不到文件或无法读取文件” - Ruby on Rails - import Bootstrap error “File not found or unreadable” 找不到导入文件或文件不可读:引导程序错误行#5 - File to import not found or unreadable: bootstrap error line #5 Sass::SyntaxError:找不到或无法读取要导入的文件:bootstrap-sprockets - Sass::SyntaxError: File to import not found or unreadable: bootstrap-sprockets Rails + Twitter Bootstrap:导入未找到或不可读的文件:twitter / bootstrap - Rails + Twitter Bootstrap: File to import not found or unreadable: twitter/bootstrap bootstrap:要导入的文件未找到或不可读 - bootstrap :File to import not found or unreadable 要导入的文件未找到或不可读:bootstrap - File to import not found or unreadable: bootstrap Rails 4 + Bower-Rails宝石+ Bower + Bootstrap Sass - Rails 4 + bower-rails gem + bower + bootstrap sass Rails 3应用程序中的Sass导入错误 - “导入未找到或不可读的文件:指南针” - Sass import error in Rails 3 app - “File to import not found or unreadable: compass” Sass :: SyntaxError:在Rails 3中找不到要导入的文件或不可读的文件 - Sass::SyntaxError: File to import not found or unreadable In Rails 3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM