2015-04-02 55 views
0

因此,我正在开发我的第一个rails项目,并试图安装bootstrap,但我遇到了一些问题。我遵循github页面上的指示,但当我做了所有事情并重新加载了我的页面时,我收到了这个错误:有人可以帮我吗?将Bootstrap安装到Rails项目中

Can someone please show me what I am doing wrong

+0

重新启动服务器?并且请将文件命名为filename.scss。和额外的CSS没有区别 – argentum47 2015-04-02 04:46:12

+0

你是对的,它现在的作品! – Swifter 2015-04-02 05:25:39

+0

用户使用sass,所以命名* .sass会更合适;) – 2015-04-02 07:52:17

回答

1

您正在将您的代码放在错误的路径中。请将文件app/assets/stylesheets.css的名称编辑为app/assets/stylesheets.css.scss,然后将@import "bootstrap-sprockets";@import "bootstrap";置于此文件中。

欲了解更多详情,请访问https://github.com/twbs/bootstrap-sass

0

我不知道,但创业板不会在这个时候工作,我建议您使用CDN或其它CSS自举的。 我没有得到使用那个宝石。

<!-- Latest compiled and minified CSS --> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> 

<!-- Optional theme --> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"> 

<!-- Latest compiled and minified JavaScript --> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> 

希望有帮助。