Question

I've got a fresh rails application, and I'm trying to use the bootstrap-sass gem. When I add @import "bootstrap"; in a .scss file in my app/assets/stylesheets folder, I get this SASS compilation error:

(Line 1: File to import not found or unreadable: bootstrap.

I've seen that many others have had this error, but everything suggested hasn't worked. I've made sure to reboot the server after running bundle install, I even deleted my entire gemset and started fresh. Still, while following the instructions on the bootstrap-sass github page, I get this error, and I can't figure it out!

Gemfile:

source 'https://rubygems.org'

ruby '2.0.0'

gem 'rails', '4.0.0.rc2'

gem 'pg', '~> 0.17.1'

gem 'coffee-rails', '~> 4.0.0'

gem 'sass-rails', '>= 3.2'

gem 'bootstrap-sass', '~> 3.0.3.0'

gem 'uglifier', '>= 1.3.0'

gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '~> 1.2'

group :doc do

gem 'sdoc', require: false

end

gem 'bcrypt-ruby', '~> 3.0.0'

And the error output:

sass --update '/app_root/app/assets/stylesheets/' > error /path/to/app_root/app/assets/stylesheets/global.scss (Line 1: >File to >import not found or unreadable: bootstrap. Load paths: /path/to/app_root/app/assets/stylesheets /path/to/app_root/app/assets/stylesheets) > Compilation exited abnormally with code 1

I'm thinking there may be an issue with the "Load Paths", but when I open a rails console and check Sass.load_paths, it includes the directory of the bootstrap-sass gem.

Any suggestions would be welcome. I've been trying to deal with this for hours now, to no avail.

Was it helpful?

Solution

Ok, I have no idea why this works, but I've been bashing my head against the problem for so long I no longer care.

I found this tutorial and followed it explicitly (easy, because my app is basically empty) from the start. It uses the rails_layout gem, and, somehow, bootstrap is now working as intended.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top