【发布时间】:2014-10-22 13:58:03
【问题描述】:
我正在尝试安装 bootstrap-sass gem。我使用 RubyMine 作为 IDE 和 rails 4.1.0。我的 gem 文件如下所示:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
gem 'sprockets', '2.11.0'
gem 'autoprefixer-rails'
gem 'sass-rails'
gem 'bootstrap-sass','3.2.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'haml'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development do
gem 'spring'
gem 'sqlite3'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
在我的application.css.scss 文件中添加以下行时,我收到一个缺少文件引用的错误:
@import "bootstrap";
@import "bootstrap-sprockets";
如果我更改为像 2.3.2 这样的早期版本的 bootstrap-sass,我可以让第一个 import 语句 (@import "bootstrap") 工作,但第二个仍然失败。同样,对于我的 application.js 文件,//= require bootstrap-sprockets 行会引发找不到文件的错误。我的 application.css.scss 是:
/*
* 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 bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
@import "bootstrap";
@import "bootstrap-sprockets";
【问题讨论】:
标签: ruby-on-rails-4 asset-pipeline rubymine bootstrap-sass