1

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?

Jamesla
  • 1,378
  • 7
  • 31
  • 62

2 Answers2

3

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

Brad Werth
  • 17,411
  • 10
  • 63
  • 88
  • Incidentally, you may want to check out my rant at http://stackoverflow.com/questions/13284077/rails-railties-gem-error-undefined-method-less/13284226#13284226 – Brad Werth Apr 16 '14 at 06:26
  • This was the problem I had actually done this however my application.css.scss lacked the .scss extension so once I added this it worked. Thanks. – Jamesla Apr 16 '14 at 06:37
0

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
Bharat soni
  • 2,686
  • 18
  • 27