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

compass-rails - Error: file to import not found or unreadable #19

Open
gshilin opened this Issue May 26, 2015 · 15 comments

Comments

Projects
None yet
@gshilin

gshilin commented May 26, 2015

I'm trying to compile a simple file

@import 'compass/reset';

Compass in installed as a gem. The result is:

SassC::SyntaxError - Error: file to import not found or unreadable: compass/reset
       Current dir: /<skipped>/app/assets/stylesheets/application/
        on line 2 of app/assets/stylesheets/application/screen.scss
>> @import 'compass/reset';
   --------^
@bolandrm

This comment has been minimized.

Member

bolandrm commented May 26, 2015

Thanks for the report. I'll try to reproduce this.

@jsdf

This comment has been minimized.

jsdf commented May 27, 2015

I've run into this also when using compass via the compass-rails gem.

@bolandrm

This comment has been minimized.

Member

bolandrm commented May 28, 2015

@gshilin @jsdf Thanks for the report.

It appears that the compass-rails gem does some monkey patching that is specific to the sass-rails gem.

Since I don't use compass, I don't think I can devote the time to fully investigating this. If there is something that sassc-raills can do to alleviate this problem, pull requests are definitely welcome.

At first glance, it appears that the compass stylesheet directories are not being added to the asset load paths. I don't know if this completely solves the issue or not, but I was able to import compass/reset after adding the following to application.rb:

    config.assets.paths.concat(
      Compass::Frameworks::ALL.map { |f| f.stylesheets_directory }
    )

@bolandrm bolandrm changed the title from Error: file to import not found or unreadable to compass-rails - Error: file to import not found or unreadable May 28, 2015

@gshilin

This comment has been minimized.

gshilin commented May 28, 2015

That's definitely helps. But now there is another error:

SassC::SyntaxError - Error: named arguments must precede variable-length argument
        on line 152 of.../compass-core-1.0.3/stylesheets/compass/_support.scss
>> e for-legacy-browser($browser, $range..., $threshold: $threshold, $ranges: $br
   ------------------------------------------^

How can I get command line options to try to reproduce it in sassc?

@bolandrm

This comment has been minimized.

Member

bolandrm commented May 28, 2015

@gshilin This one does seem to be a discrepancy between libsass and ruby sass.

here is the relevant mixin: https://github.com/Compass/compass/blob/stable/core/stylesheets/compass/_support.scss#L146-L158

If you want to verify the issue using only libsass, you could build/use this CLI: https://github.com/sass/sassc

Anyway - you can report it that here: https://github.com/sass/libsass/issues

@adambair

This comment has been minimized.

adambair commented Jul 12, 2015

Could be related? sass/libsass#1259

@orlando

This comment has been minimized.

orlando commented Jul 13, 2015

I think that compass requires ruby-sass, and doesn't work with libsass. You can use http://bourbon.io/ to replace some of the mixins compass has.

@bslipek

This comment has been minimized.

bslipek commented Aug 4, 2015

any update on this ? :-(

@gon

This comment has been minimized.

gon commented Oct 8, 2015

What @bolandrm suggests works for now, it properly loads compass stylesheets!

@perplexes

This comment has been minimized.

perplexes commented Dec 11, 2015

We ended up removing compass and putting https://github.com/Igosuki/compass-mixins into vendor/assets/stylesheets/compass-mixins, then putting this in our application.rb:

config.assets.paths << "vendor/assets/stylesheets/compass-mixins/lib"

That seemed to do the trick. Now we're running into #42 with https://github.com/tsechingho/chosen-rails. Our asset urls are schemaless (on cloudfront). But the end is near. Thanks @bolandrm and everyone! This dropped our stylesheet compile time in Rails 4.0 from 70 seconds to nearly instant.

@jclusso

This comment has been minimized.

jclusso commented Mar 25, 2016

@gon I get this when I do what @bolandrm suggested.

Error: Undefined operation: "prefix-usage(browser-prefixes(browsers()), css-boxshadow, (full-support: true), (partial-support: true)) gt 0.1".
        on line 324 of ../../../../.rvm/gems/ruby-2.2.3@project/gems/compass-core-1.0.3/stylesheets/compass/_support.scss
>>   @if $usage > $threshold {
   ------^```
@jclusso

This comment has been minimized.

jclusso commented Jul 7, 2016

Has anyone had any luck resolving this?

@JustinAiken

This comment has been minimized.

JustinAiken commented Jul 28, 2016

Also something similar with compass-blueprint:

rake aborted!
SassC::SyntaxError: Error: File to import not found or unreadable: blueprint
       Parent style sheet: /Users/jaiken/projects/usertesting/orders/app/assets/stylesheets/site/_base.scss
        on line 8 of app/assets/stylesheets/site/_base.scss
>> @import "blueprint";
   ^
/Users/jaiken/projects/usertesting/orders/app/assets/stylesheets/site/_base.scss:8
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sassc-1.10.0/lib/sassc/engine.rb:46:in `render'
/Users/jaiken/.rvm/gems/ruby-2.3.1/bundler/gems/sassc-rails-a7e1b5f653e8/lib/sassc/rails/template.rb:34:in `block in call'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/utils.rb:167:in `module_include'
/Users/jaiken/.rvm/gems/ruby-2.3.1/bundler/gems/sassc-rails-a7e1b5f653e8/lib/sassc/rails/template.rb:33:in `call'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/sass_processor.rb:30:in `call'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:75:in `call_processor'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:56:in `call_processors'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:60:in `block in load'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:44:in `load'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/cached_environment.rb:47:in `load'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/bundle.rb:23:in `block in call'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/utils.rb:196:in `dfs'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/bundle.rb:24:in `call'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:75:in `call_processor'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/processor_utils.rb:56:in `call_processors'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:60:in `block in load'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/loader.rb:44:in `load'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/cached_environment.rb:47:in `load'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/base.rb:66:in `find_asset'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/manifest.rb:134:in `block in find'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/manifest.rb:133:in `each'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/manifest.rb:133:in `find'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/sprockets/manifest.rb:185:in `compile'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3/lib/rake/sprocketstask.rb:147:in `with_logger'
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
@jclusso

This comment has been minimized.

jclusso commented Nov 16, 2016

Any update on this?

@bparanj

This comment has been minimized.

bparanj commented Dec 14, 2016

@bolandrm suggestion works. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment