1

when using the bootstrap-sass gem i have loaded my css files properly, however have been receiving an error when i try loading the javascript files. I have followed the procedure of loading javascript from https://github.com/twbs/bootstrap-sass however when I view my webpage on localhost

I receive the error "couldn't find file 'bootstrap'"

This is what my application.js file looks like - Any help would be much appreciated!
Application.js
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
// Loads all Bootstrap javascripts
//= require bootstrap
//= require_tree .
eNN
  • 173
  • 3
  • 17

3 Answers3

3

From the Rails 4 the :assets group isn't used anymore, please remove the group from Gemfile:

Rails 4.0 removed the assets group from Gemfile. You'd need to remove that line from your Gemfile when upgrading. You should also update your application file (in config/application.rb):

Bundler.require(:default, Rails.env)

Community
  • 1
  • 1
Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69
1

I got it to work by removing gem 'bootstrap-sass', '~> 3.0.3.0' out of the assets group in gemfile! YAY

eNN
  • 173
  • 3
  • 17
0

Did you bundle install and make sure you are loading application.js (from the assets pipeline).

Peeyush
  • 6,144
  • 5
  • 23
  • 37
  • How do you make sure you are loading application.js from the assets pipeline? – eNN Jan 28 '14 at 18:53
  • Let us say in Rails 4 if you are using `application.html.erb` as layout, if it contains something like `<%= javascript_include_tag "application", "data-turbolinks-track" => true` then you can be sure that it is included. – Peeyush Jan 28 '14 at 19:09
  • in that case it is included. Do you know what else it could be? – eNN Jan 28 '14 at 19:12
  • I got it to work by removing gem 'bootstrap-sass', '~> 3.0.3.0' out of the assets group in gemfile! YAY – eNN Jan 28 '14 at 19:19