Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.1.1 - Sass::SyntaxError - File to import not found or unreadable: compass. #164

Closed
andywenk opened this issue May 22, 2014 · 9 comments

Comments

@andywenk
Copy link

Hi,
we can't get compass-rails work within the following setup:

Gemfile:

gem 'rails', '4.1.1'

group :assets do
  gem 'sass-rails'
  gem 'compass-rails'

app/assets/stylesheets/application.css.scss

/*
 *= require_self
 */

@import "compass";

Stacktrace: https://friendpaste.com/3fk7mgOiStKrV27vzNSURR

The basic error message is:

Sass::SyntaxError - File to import not found or unreadable: compass.

Wether I do sth. completely wrong or I do have a misunderstanding for @import 'compass'; in app/assets/stylesheets/application.css.scss.

Any info is highly appreciated :)

Cheers

Andy

@Silex
Copy link

Silex commented May 27, 2014

Probably related to #155

I found that the following works:

gem 'compass-rails', '~> 1.1.7'
gem 'sass-rails'

Outside of the assets group.

Which by me installs the following versions:

compass (0.12.6)
compass-rails (1.1.7)
sass (3.2.19)
sass-rails (4.0.3)

@greypants
Copy link

Moving compass-rails out of the assets group worked for me.

@McRip
Copy link

McRip commented Jun 10, 2014

The solution from @Silex worked for me. Besides compass-rails i also had to move sass-rails out of the assets group.

@bodrovis
Copy link

Actually Rails 4 does not have assets group as far as I know

@foobarfoobar
Copy link

@bodrovis You are right. Tried many versions, but nothing worked. Any solution???

@gon
Copy link

gon commented Oct 8, 2015

See sass/sassc-rails#19 (comment) for a temporary fix, it worked for me.

@amitfriedman12
Copy link

Try this:

gem 'sass-rails'
gem 'compass-rails', github: 'Compass/compass-rails

You should also make sure these gems are NOT included inside your asset group, since it has been removed from Rails 4.0

Then remove your gemfile.lock file and regenerate it using the bundle command.

@zachary95
Copy link

zachary95 commented Dec 10, 2016

I did the exact following solutions, still have the "File import not found or unreadable: compass." error.

Here's the Gemfile :

gem 'sass-rails'
gem 'compass-rails', github: 'Compass/compass-rails'

I'm using Rails 5

@LindaKadz
Copy link

I had the same problem
sass::syntaxerror: file to import not found or unreadable: config/variables.
, I opened a new css file (I called it custom.css) then copied all the css to the file. On application.css I removed the

@import "config/variables" plus all the other @imports

This worked for me, I hope it does work for you too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests