5

I got a problem when adding bootstrap into my rail project. The error message is given as:

File to import not found or unreadable: bootstrap-sprockets.

Output

I have tried the following two solutions but none of them works for me.

Solution 1: Couldn't find file 'twitter/bootstrap' (ROR)

Solution 2: Sprockets::FileNotFound couldn't find file 'bootstrap' with type 'text/css'

2
  • which gem are you using? Commented Aug 30, 2016 at 1:29
  • 1
    @ArunKumar My way of installing: step 1: gem "bower-rails", "~> 0.10.0"; step2: asset 'bootstrap'; step3: rake bower:install Commented Aug 30, 2016 at 1:33

3 Answers 3

7

In here

It says,

  1. Rename your application.css to application.scss.

  2. Delete *= require self and require tree

  3. Add @import bootstrap-sprockets and bootstrap at the last line of the file.

Hope this helps.

I had the same issue.

Sign up to request clarification or add additional context in comments.

Comments

5

First you need add gem gem 'bootstrap-sass', '3.3.6' to your Gemfile then bundle install then you must

@import "bootstrap-sprockets";
@import "bootstrap";

to your scss file. Hope it will help you.

1 Comment

Thanks! Adding gem 'bootstrap-sass' seemed to be the critical piece. Do the gems, 'bootstrap-sass' and 'rails-sass', overlap in functions? Do they conflict?
4

If Bootstrap was installed with yarn, I found that reinstalling it solved the issue:

yarn add bootstrap

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.