Can't run bootsrap : couldn't find file 'bootstrap-sprockets' with type 'application/javascript'

12,044

Solution 1

Try removing bootstrap-sprockets from your application.js. It doesn't need to be there, and it's creating the error.

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require turbolinks
//= require_tree .

Solution 2

I had the same issue:

couldn't find file 'bootstrap-sprockets' with type 'application/javascript'

The only solution was to comment off:

# gem 'sass-rails', '~> 5.0' 

And add instead:

gem 'sass-rails', '>= 3.2'

In the Gemfile, I hope this helps other members.

Share:
12,044
icecreamrabbit
Author by

icecreamrabbit

Updated on August 08, 2022

Comments

  • icecreamrabbit
    icecreamrabbit over 1 year

    Having some problems installing bootstrap onto my rails project.

    howing /Users/muhname/Photogur/app/views/layouts/application.html.erb where line #10 raised:

    couldn't find file 'bootstrap-sprockets' with type 'application/javascript'

    my application.js file:

    //= require jquery
    //= require jquery_ujs
    //= require bootstrap
    //= require bootstrap-sprockets
    //= require turbolinks
    //= require_tree .
    

    my css:

    /  *= require bootstrap_and_overrides
    /  *= require_tree .
    /  *= require_self
    / /*
    
    @import "bootstrap"
    

    gem: 'bootstrap-sass', '3.0.2.1'

    Anybody who might know what the issue is? thanks!

    • Venkat Ch
      Venkat Ch almost 9 years
      How did you included bootstrap-sass', '3.0.2.1' in the Gemfile? I guess, if this was included in group :assets, please move out from this and it should work. This is because, I think you are using Rails4 and it drops support for assets group in gemfile. See here
    • Elvn
      Elvn almost 9 years
      Will you please post the code block around the error you mentioned? Users/muhname/Photogur/app/views/layouts/application.html.er‌​b: line #10
    • Tᴀʀᴇǫ Mᴀʜᴍᴏᴏᴅ
      Tᴀʀᴇǫ Mᴀʜᴍᴏᴏᴅ over 7 years
      This would be the correct solution: stackoverflow.com/a/28322353/5645769