簡體   English   中英

嘗試安裝Ruby Gem的新用戶(bootstrap)

[英]New user trying to install a Ruby Gem (bootstrap)

我是rails的新手,我正在嘗試創建一個新項目並添加bootstrap 3 ruby​​ Gem( https://rubygems.org/gems/bootstrap-sass ),我無法弄清楚我做錯了什么。

我創建了新的應用程序:

rails new demoapp

我將以下行添加到Gemfile中

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

我捆綁它

bundle install

我跑了

rails server

但是我的網站上沒有引導程序,我不能使用bootstrap css,我做錯了什么?

您需要將boot strap添加到資產文件中。

將Bootstrap導入Sass文件(例如,application.css.scss)以獲取Bootstrap的所有樣式,混合和變量!

來自https://github.com/twbs/bootstrap-sass

基本上,添加@import "bootstrap"; 到您的application.css.scss文件...

您需要在GemFile中添加gem

gem 'bootstrap-sass'

然后運行以下命令

bundle install

無需跑步

gem install bootstrap-sass

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM