0

I have followed the "Ruby on Rails Tutorial" by Michael Hartl to "5.1.2 Bootstrap and custom CSS." Basically, I added bootstrap-sass gem on my Gemfile, installed it; added config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif) to config/application.rb; created the file: app/assets/stylesheets/custom.css.scss, and added the line: @import "bootstrap"; to custom.css.scss.

However, when I tried to run my rails home page on my local rails server, I got the following error:

ActionView::Template::Error (No such file or directory - /Users/boss/Documents/Aptana/vendor (in /Users/boss/Documents/Aptana/test3/app/assets/stylesheets/custom.css.scss)):
2: <html>
3:   <head>
4:     <title><%= full_title(yield(:title)) %></title>
5:     <%= stylesheet_link_tag "application.css", media: "all", "data-turbolinks-track" => true %>
6:     <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7:     <%= csrf_meta_tags %>
8:     <!--[if lt IE 9]>
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__3756317890019596621_70094001398520'

Any ideas why I get the error?

yrs7
  • 1
  • 1
  • 1
  • 4

2 Answers2

0

Looks like the same issue as this question: Errno::ENOENT No such file or directory Rails 4

I hit exactly the same problem today and following the advice on the linked question to change the sass-rails version to 4.0.3 fixed the issue for me.

Community
  • 1
  • 1
0

I had the same problem with a Rails 3.2.19 app. The RAILS_ROOT was being missed out in the Sass.load_paths param causing it to look in /Users/Ian/vendor rather than /Users/Ian/rails_app/vendor. In your case it seems it is missing out the /test3 part of the path Turns out it is a 'feature/bug' in the latest sass gem (3.4.2) released on August 29. Adding

gem 'sass', '3.4.1'

to the Gemfile fixed it. Not sure exactly what the 3.4.2 version of sass is doing though.

Update: I think it is a clash with the bootstrap-sass 2.x gem, with the latest bootstrap-sass gem (3.2.0.2) there is no error with sass 3.4.2. I filed an issue here https://github.com/sass/sass/issues/1418 but I don't know if it is sass or bootstrap-sass that is at fault.

Ian
  • 196
  • 8