I am new to rails and I'm trying to create a new project and add the bootstrap 3 ruby Gem ( https://rubygems.org/gems/bootstrap-sass ) and I can't work out what I'm doing wrong.
I create the new application:
rails new demoapp
I add the following line to the Gemfile
gem 'bootstrap-sass', '~> 3.1.1'
I bundle it
bundle install
I run it
rails server
However no bootstrap is present on my site and I can't use bootstrap css, what am I doing wrong?
You need to add boot strap to the assets file.
Import Bootstrap into a Sass file (for example, application.css.scss) to get all of Bootstrap's styles, mixins and variables!
From https://github.com/twbs/bootstrap-sass
Basically, add @import "bootstrap";
to your application.css.scss file...
You need to add the gem inside the GemFile like
gem 'bootstrap-sass'
And then run the following command
bundle install
No need to run
gem install bootstrap-sass
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.