我正在使用bootstrap-sass gem和我的rails (3.2.5)应用程序,并且在我本地的开发环境中运行得很好。但是,当我在Heroku上部署prod时,引导CSS并没有包含在编译后的资源中。
我在Gemfile中添加了bootstrap-sass和sass-rails:
gem 'bootstrap-sass', '2.0.3.1'
group :assets do
gem 'sass-rails', '3.2.4'
end我在我的assets目录中的custom.css文件中添加了一个用于引导的导入:
@import "bootstrap";基本的东西。你知道为什么这个在Prod中不起作用吗?
发布于 2012-06-19 16:03:50
您必须在app/assets/stylesheets中添加一个包含以下内容的bootstrap_and_overrides.css.scss文件:
// Set the correct sprite paths
$iconSpritePath: asset-url('glyphicons-halflings.png', image);
$iconWhiteSpritePath: asset-url("glyphicons-halflings-white.png", image);
@import "bootstrap";
@import "bootstrap-responsive";此外,您还必须在application.js中添加
//= require bootstrap 致以问候!
发布于 2013-09-25 02:10:45
我遇到了完全相同的问题。以下是我用来解决这个问题的步骤:
https://stackoverflow.com/questions/11092664
复制相似问题