css – 要导入的文件未找到或不可读:bootstrap(Bootstrap,Rails,Sass错误)

前端之家收集整理的这篇文章主要介绍了css – 要导入的文件未找到或不可读:bootstrap(Bootstrap,Rails,Sass错误)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的application.css.scss
/*
 *= require_self
 *= require_tree .
 *= require social-share-button
 */

我正在使用这个宝石 – https://github.com/twbs/bootstrap-sass

按照说明,这是我的:资产组在我的Gemfile中:

group :assets do
  gem 'sass-rails','~> 4.0.3'
  gem 'uglifier','>= 1.3.0'
  gem 'coffee-rails','~> 4.0.0'
  gem "font-awesome-rails"
  gem 'bootstrap-sass','~> 3.2.0'
  gem 'autoprefixer-rails'
end

我创建了一个名为bootstrap_and_overrides.css.scss的文件,它有:

@import "bootstrap-sprockets";
@import "bootstrap";
@import "bootstrap-responsive";
@import "font-awesome";

这是错误

Sass::SyntaxError at /
File to import not found or unreadable: bootstrap-sprockets.
/app/assets/stylesheets/bootstrap_and_overrides.css.scss:1)

这是我的application.js:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require bootstrap-sprockets
//= require social-share-button
//= require_tree .

我已经重新启动了我的服务器多次,并从隐身窗口查看了我的应用程序。

我使用的是Rails 4.1.1和Ruby 2.1.1。

有什么建议么?

更新1:

对于什么是值得的,这是我的应用程序/资产/样式表/看起来像:

$ ls
application.css.scss            bootstrap.css               font-awesome.min.css
bootstrap-social.css            bootstrap.min.css           locations.css.scss
bootstrap-theme.css         bootstrap_and_overrides.css.scss    main.css
bootstrap-theme.min.css         font-awesome.css            posts.css.scss

@R_404_323@

我在这里找出了这个问题。

问题是我正在使用:资产组。这在Rails 4中被删除了。

http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0-gemfile

**4.2 Gemfile**
Rails 4.0 removed the assets group from Gemfile. You'd need to remove that line from your Gemfile when upgrading.

一旦我把他们从资产组中删除,我删除了我的Gemfile.lock并运行捆绑安装…一切都很完美。

希望这有助于一些其他可怜的灵魂。

原文链接:https://www.f2er.com/css/218131.html

猜你在找的CSS相关文章