Bootstrap没有为我加载。我做错了什么?
application.scss (完整文件,不包含任何其他内容)
// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
@import "bootstrap-sprockets";
@import "bootstrap";
@import "bootstrap/theme";Gemfile
gem 'bootstrap', '~> 4.0.0.alpha4'
gem 'bootstrap-sass', '~> 3.1.1'
gem 'bootstrap-sass-extras'HTML IN标题显示(运行rails s,在开发模式下):
<link rel="stylesheet" media="all" href="/stylesheets/application.css">发布于 2016-09-26 00:32:05
您是否尝试过:
rails generate bootstrap:install static
rails generate bootstrap:install less发布于 2016-09-26 00:47:59
根据您提供的信息,这有点难以追踪。您是否已将样式文件重命名为.scss扩展名?确保按照文档中的安装说明进行操作:Bootstrap 4 alpha.
看起来你正在使用你不需要的额外的gem。如果您使用的是alph 4版本的bootstrap,则只需要在gem文件中使用该版本,而不需要版本3。请确保在application.js文件中包含正确的依赖关系:
//= require jquery
//= require bootstrap-sprockets以及:
@import "bootstrap";在您的application.scss文件中。
您必须配置这些文件,然后确保重新启动应用程序才能使更改生效。希望这能有所帮助!
https://stackoverflow.com/questions/39689155
复制相似问题