Ask A Question


You’re not receiving notifications from this thread.

Issue with bootstrap sprockets in application.js

Damian Nelwep asked in Rails


As said in the title, I get an error message when I try to access my localhost:3000.

The message is :

Sprockets::FileNotFound in Welcome#index

Showing /home/dameaw/work/five/meawinit/app/views/layouts/application.html.erb where line #8 raised:

couldn't find file 'bootstrap-sprockets' with type 'application/javascript'
Checked in these paths: 

I try to get rid of '//= require bootstrap-sprockets' in the application.js file but when I do that, the style is completly broken.

Thank you for your advices in advances and have a sweet day :)


Looks like you have a version issue here.

The gem version of bootstrap-sass specifies an import with

//= require bootstrap-sprockets

Whereas your version seems to be the It specifies an import like this :

We have a helper that includes all available javascripts:

// Loads all Bootstrap javascripts
//= require bootstrap

You can also load individual modules, provided you sort out any related dependencies.

//= require bootstrap-scrollspy
//= require bootstrap-modal
//= require bootstrap-dropdown

You should fix your gem version in your gemfile to and use the correct way to call the lib.


Thank you very much for the tip.

At first I tried to put "gem 'bootstrap-sass', '~>'" in the Gemfile and it turned out I got no error message but big display problems, mainly in the menu.

So I finally changed the Gemfile version to "gem 'bootstrap-sass', '~> 3.4', '>= 3.4.1'" and put back '//= require bootstrap-sprockets' in application.js and now it works perfectly :)

This is because I struggle installing some gems like social_stream. And now I'm trying to install mailboxer. Would you know a good gem for messaging/social purpose ?

Anyways thank you for your advice which has been a very good help for me :) Have a nice day mate


Yeah, even better if you're using a more recent version of bootstrap.

In terms of messaging/social purpose I would suggest to develop those features by yourself. There are not too complicated and it is better to control your features than to force yourself to use a library that will probably end up causing you more troubles than solutions.

It is based on my personal experience.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,603+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.