简体   繁体   中英

File to import not found or unreadable: bootstrap error line #5

Gemfile

group :assets do
  gem 'bootstrap-sass', '~> 3.2.0'
  gem 'sass-rails', '>= 3.2'
  gem 'uglifier', '>= 1.3.0'
  gem 'coffee-rails', '~> 4.0.0'
end

application.html.erb

 <!DOCTYPE html>
 <html>
   <head>
    <title>One Month Rails</title>
    <%= stylesheet_link_tag    "application", :media => "all" %>   #This line is the 1st line error.

application.js

 //= require bootstrap  #added this in.

styles.css.scss

 @import 'bootstrap';
 @import 'bootstrap-responsive';

Showing C:/Temp/demo/code/omrails/app/views/layouts/application.html.erb where line #5 raised:

File to import not found or unreadable: bootstrap. Load paths:

C:/Temp/demo/code/omrails/app/assets/images
C:/Temp/demo/code/omrails/app/assets/javascripts
C:/Temp/demo/code/omrails/app/assets/stylesheets
C:/Temp/demo/code/omrails/vendor/assets/javascripts
C:/Temp/demo/code/omrails/vendor/assets/stylesheets
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/turbolinks-2.3.0/lib/assets/javascripts C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-rails-3.1.2/vendor/assets/javascripts (in C:/Temp/demo/code/omrails/app/assets/stylesheets/styles.css.scss:1)

I tried restarting rails server as all the other suggestions here posted. Still same problem.

bootstrap-responsive.css (and related Sass/Less files) was part of Bootstrap v2 and was eliminated in Bootstrap v3 (because responsiveness became baked-in).

You're using Bootstrap v3 (per gem 'bootstrap-sass', '~> 3.2.0' ), so you're trying to reference a nonexistent file, hence the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM