user2012677
user2012677

Reputation: 5735

Bootstrap-sass not loading

Bootstrap is not loading for me. What am I doing wrong?

application.scss (complete file, nothing else in it)

// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
@import "bootstrap-sprockets";
@import "bootstrap";
@import "bootstrap/theme";

Gemfile

gem 'bootstrap', '~> 4.0.0.alpha4'
gem 'bootstrap-sass', '~> 3.1.1'
gem 'bootstrap-sass-extras'

HTML IN HEADER SHOWS (running rails s, in development mode):

<link rel="stylesheet" media="all" href="/stylesheets/application.css">

Upvotes: 1

Views: 746

Answers (2)

hackrnaut
hackrnaut

Reputation: 583

This is a little hard to track down with the information you provided. Have you renamed your style files to .scss extention? Make sure you follow the installation instructions in the docs: Bootstrap 4 alpha.

It looks like you are using extra gems you don't need. If you are using the alph 4 version of bootstrap, you only need that in your gem file, you do not need version 3. Make sure include the right dependencies in your application.js file:

//= require jquery
//= require bootstrap-sprockets

as well as:

@import "bootstrap";

in your application.scss file.

You have to configure these files and then make sure you restart your application in order for the changes to take place. Hope this helps!

Upvotes: 0

Pierangelo Orizio
Pierangelo Orizio

Reputation: 824

have you try :

rails generate bootstrap:install static

rails generate bootstrap:install less

Upvotes: 1

Related Questions