Error compiling scss files on MacRuby #538

Closed
joefiorini opened this Issue Oct 5, 2012 · 8 comments

Projects

None yet

3 participants

@joefiorini

I'm getting the following error trying to compile scss files using a recent MacRuby 0.13 nightly. Is this the right for this issue? Here's the error:

#<Thread:0x401812ee0 run> (2012-10-05 18:11:54) Error: Problem transmitting data -- #<NoMethodError: super: no superclass method `visit' for #<Sass::Tree::Visitors::SetOptions:0x401949cc0 ...>>

And here's the stack trace:

Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/tree/visitors/set_options.rb:15:in `visit'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/tree/visitors/base.rb:53:in `block'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/tree/visitors/base.rb:53:in `visit_children'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/tree/visitors/base.rb:39:in `visit'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/tree/visitors/set_options.rb:15:in `visit'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/tree/visitors/set_options.rb:5:in `visit'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/tree/node.rb:69:in `options='
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/engine.rb:355:in `_to_tree'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/engine.rb:315:in `_render'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass/engine.rb:262:in `to_css'
/Users/joe/.rbenv/versions/macruby-0.13/lib/bundler/gems/sass-1bbdfb8d30d2/lib/sass.rb:54:in `compile'
[...]
/Users/joe/.rbenv/versions/macruby-0.13/lib/gems/rake-0.9.2.2/lib/rake/task.rb:203:in `block'
/Users/joe/.rbenv/versions/macruby-0.13/CTLOG::93784#<Thread:0x401812ee0 run> (2012-10-05 18:11:54) Error: Problem transmitting data -- #<NoMethodError: super: no superclass method `visit' for #<Sass::Tree::Visitors::SetOptions:0x401949cc0 ...>>

Thanks!

@joefiorini

Also worth noting this happens on a gem install of 3.2.1 and using latest HEAD via Bundler.

@joefiorini

I tried running the same set of stylesheets against 3.1.20 (since that's the version that, according to the CHANGELOG, introduced MacRuby support). With that I'm getting a syntax error against normalize.scss, a file that is compiled without issue on MRI.

So I tried something more basic:

Sass::Engine.new("body { color: red; }", :syntax => :scss)

Running that against 3.1.20 (and also under 3.2.1) I get yet another different error:


/Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/script/string.rb:36:in `to_s': undefined method `tr' for nil:NilClass (NoMethodError)
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:217:in `visit_prop'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:37:in `visit'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:18:in `visit'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:53:in `block'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:27:in `block'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:37:in `block'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:238:in `visit_rule'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:37:in `visit'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:18:in `visit'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:53:in `block'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:27:in `block'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:37:in `block'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:47:in `visit_root'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/base.rb:37:in `visit'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:18:in `visit'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/visitors/perform.rb:7:in `visit'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/tree/root_node.rb:20:in `render'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/engine.rb:300:in `_render'
    from /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.1.20/lib/sass/engine.rb:247:in `to_css'
    from /Users/joe/Sites/joefiorini.com/test.rb:12:in `<main>'

I've tried these against the latest MacRuby nightly and the 0.12 stable release, with no luck. Any thoughts here?

@joefiorini

I actually get that error when I call render. If I comment out the super call in Literal#initialize (lib/sass/script/literal.rb:28) then I don't get the error anymore, but I do start getting unexpected syntax errors. Here is my IRB session showing the error. Can anyone get this to pass on the latest MacRuby nightly?

Thanks!

irb(main):001:0> MACRUBY_VERSION
=> "0.13"
irb(main):002:0> MACRUBY_REVISION
=> "git commit d900e4bf92cb1342b40aa83f5b1fe699a61a8d59"
irb(main):003:0> require 'rubygems'
=> true
irb(main):004:0> require 'sass'
=> true
irb(main):005:0> e = Sass::Engine.new("body { color: red; }", :syntax => :scss)
=> #<Sass::Engine:0x40089df20 @options={:style=>:nested, :load_paths=>[#<Sass::Importers::Filesystem:0x40088e920 @root="/Users/joe/Sites/joefiorini.com">], :cache=>true, :cache_location=>"./.sass-cache", :syntax=>:scss, :filesystem_importer=>Sass::Importers::Filesystem, :original_filename=>nil, :cache_store=>#<Sass::CacheStores::Chain:0x400892820 @caches=[#<Sass::CacheStores::Memory:0x40089e980 @contents={}>, #<Sass::CacheStores::Filesystem:0x40089e960 @cache_location="./.sass-cache">]>, :line_comments=>nil, :property_syntax=>nil} @template="body { color: red; }">
irb(main):006:0> e.render
NoMethodError: undefined method `tr' for nil:NilClass
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/script/string.rb:37:in `to_s'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:295:in `visit_prop'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:98:in `visit'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:53:in `block'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:107:in `block'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:119:in `with_environment'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:106:in `visit_children'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:37:in `block'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:316:in `visit_rule'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:98:in `visit'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:53:in `block'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:53:in `visit_children'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:107:in `block'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:119:in `with_environment'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:106:in `visit_children'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:37:in `block'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:126:in `visit_root'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/base.rb:37:in `visit'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:98:in `visit'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:7:in `visit'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/tree/root_node.rb:20:in `render'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/engine.rb:315:in `_render'
    /Users/joe/.rbenv/versions/macruby-0.13/lib/gems/sass-3.2.1/lib/sass/engine.rb:262:in `to_css'
@joefiorini

Just spent some time debugging this on IRC with a member of MacRuby team and we couldn't figure out what was wrong.

@nex3
Contributor
nex3 commented Oct 12, 2012

I'm not sure what's going wrong here either, and I don't have a MacRuby installation available to test on. Since this works on other Ruby implementations, I'm going to assume for now that it's a MacRuby bug. If anyone can figure out what's going wrong in more detail or can come up with a patch to fix or work around the issue, please post here.

@nex3 nex3 closed this Oct 12, 2012
@joefiorini

@nex3 Thanks for replying. I haven't been able to ascertain the root cause on the MacRuby side. I'm looking at using hcatlin/libsass now instead (which I have compiled into a bundle that's working in MacRuby). However, it's important that I have access to Compass, which obviously will not work with libsass. The thought crossed my mind to monkeypatch Sass's rendering and replace it with calls into libsass? Would that even be possible or is this just a pipe dream?

@nex3
Contributor
nex3 commented Oct 19, 2012

I don't think that's feasible. Even if it could work, it would almost certainly be more effort than figuring out what the underlying bug here is.

@thelucid
thelucid commented Sep 4, 2013

Sorry for commenting on an old ticket but I'm getting:

/Library/Ruby/Gems/MacRuby/0.12/gems/sass-3.2.10/lib/sass/script/string.rb:36:in `to_s': undefined method `gsub' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/MacRuby/0.12/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:299:in `visit_prop'

...anyone find a fix for this?

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