简体   繁体   English

使用bootstrap-sass gem使用twitter bootstrap 3和rails

[英]Using twitter bootstrap 3 with rails using bootstrap-sass gem

Right now my bootstrap css version is v2.3.2 with following gem 现在我的bootstrap css版本是v2.3.2,带有以下gem

gem 'bootstrap-sass', '~> 2.3.2.1'

I tried to upgrade it by using following configuration 我尝试使用以下配置升级它

gem 'bootstrap-sass', git: 'https://github.com/thomas-mcdonald/bootstrap-sass.git', branch: '3'

But after restarting the server and everything the version remained the same 但重新启动服务器后,版本保持不变

So I tried bundle exec rake convert , maybe it could fix the problem 所以我尝试bundle exec rake convert ,也许它可以解决问题

But it kept throwing 但它一直在投掷

Don't know how to build task 'convert'

So does anyone have any idea how to implement bootstrap v3 into my rails project ?? 那么有谁知道如何将bootstrap v3实现到我的rails项目中?

I had to run this command 我不得不运行这个命令

rake tmp:clear

In order to clear the cache from bootstrap v2 files 为了从bootstrap v2文件中清除缓存

As per the instructions at rubygems.org, you have to run this command to get the new gem. 根据rubygems.org上的说明,您必须运行此命令才能获得新的gem。 I assume this is because it is using release candidates. 我认为这是因为它正在使用候选版本。

$ gem install bootstrap-sass --pre

I don't know how you would do this in the Gemfile. 我不知道如何在Gemfile中执行此操作。

The bootstrap-sass github page is not so clear. bootstrap-sass github页面不太清楚。 You don't need to run the convert task unless you're working or developing the gem itself. 除非您正在使用或开发gem本身,否则无需运行转换任务。 You just need to follow the bootstrap-sass rails install guide 您只需要遵循bootstrap-sass rails安装指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM