Question

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?

Was it helpful?

Solution

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...

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top