pushian
pushian

Reputation: 91

couldn't find file 'bootstrap' with type 'text/css'

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'

Upvotes: 5

Views: 17914

Answers (3)

NZisKool
NZisKool

Reputation: 239

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

yarn add bootstrap

Upvotes: 4

Iqlaas Ismail
Iqlaas Ismail

Reputation: 405

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.

Upvotes: 6

AnhNguyen
AnhNguyen

Reputation: 51

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.

Upvotes: 5

Related Questions