I recently attended a hackathon, and we a made a web application in rails. We were all new to rails and were not aware of the bootstrap gem, and thus we hard coded the bootstrap style sheet in the assets folder.
In an effort to learn Rails, further, I'm continuing with the app. I have deleted the .css file, and added the gem to my Gemfile. I've ran bundle install and imported the files using the '@import' command in another CSS file.
When I run the rails server and navigate to my homepage, I get an error:
Sass::SyntaxError in Pages#rootpage
Showing C:/Users/User/Documents/SoapBox/app/views/layouts/application.html.erb where line #6 raised:
File to import not found or unreadable: bootstrap.
Load paths:
C:/Users/Soham/Documents/SoapBox/app/assets/images
C:/Users/Soham/Documents/SoapBox/app/assets/javascripts
C:/Users/Soham/Documents/SoapBox/app/assets/stylesheets
C:/Users/Soham/Documents/SoapBox/vendor/assets/javascripts
C:/Users/Soham/Documents/SoapBox/vendor/assets/stylesheets
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/turbolinks-1.3.0/lib/assets/javascripts
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-rails-3.0.4/vendor/assets/javascripts
(in C:/Users/Soham/Documents/SoapBox/app/assets/stylesheets/styles.css.scss:2)
`File to import not found or unreadable: bootstrap`.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href='http://fonts.googleapis.com/css?family=Oswald:700,300' rel='stylesheet' type='text/css'>
<%= favicon_link_tag "favicon.png", :type => "image/png", :rel => "icon" %>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
I don't understand why the error is occurring.
Any help would be much appreciated!
Thanks!
SohamK
Add the extension
.scss
toapplication.css
. If you deleted it, then add it again.It should look like this:
It is VERY important to use that import in an
.scss
file. Otherwise it won't work.Make sense?