skip to Main Content

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'

3

Answers


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

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. If Bootstrap was installed with yarn, I found that reinstalling it solved the issue:

    yarn add bootstrap
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search