Sprites error after updating compass

1,224 views
Skip to first unread message

Gary Clarke

unread,
Feb 8, 2012, 2:23:32 PM2/8/12
to compas...@googlegroups.com
I updated ruby and had to re-install gems:

gem install sass --pre
gem install compass --pre

By selective removal of sass code I tracked down a watch error that is now occurring due to the following statement:

@import "../shared/images/icon/*.png";

The error is "TypeError on line ["27"] of C: can't convert Array into String".

This same code was working before the re-install. Here's the first part of the stack trace:

  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/sprites/image_methods.rb:27:in `block in sprite_names'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/sprites/image_methods.rb:27:in `map'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/sprites/image_methods.rb:27:in `sprite_names'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/sprites/sprite_methods.rb:36:in `validate!'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/sprites/sprite_map.rb:47:in `initialize'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/sprites/sprite_map.rb:22:in `new'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/sprites/sprite_map.rb:22:in `from_uri'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.1/lib/compass/sass_extensions/functions/sprites.rb:48:in `sprite_map'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.0.alpha.64/lib/sass/script/funcall.rb:88:in `_perform'

I reviewed the sprite tutorial at http://beta.compass-style.org/help/tutorials/spriting/, but as far as I can tell the usage hasn't changed.

Any thoughts on what might be happening?

Thanks for your help,
Gary


Chris Eppstein

unread,
Feb 8, 2012, 2:37:01 PM2/8/12
to compas...@googlegroups.com
The import is relative to your images directory. Please just use:

@import "icon/*.png";



--
You received this message because you are subscribed to the Google Groups "Compass" group.
To view this discussion on the web visit https://groups.google.com/d/msg/compass-users/-/cO5FICMLK2oJ.
To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.

Gary Clarke

unread,
Feb 8, 2012, 2:43:30 PM2/8/12
to compas...@googlegroups.com
Chris, 

The path "../shared/images/icon" is relative the the compass images directory. My raw image assets are in a different folder because I'm sharing some files across projects:

  /images -> this is the compass project images folder
  /shared/images/icon -> this is what I'm importing

Any thoughts?

Regards,
Gary

Chris Eppstein

unread,
Feb 8, 2012, 3:10:59 PM2/8/12
to compas...@googlegroups.com
In 0.12, you should add the shared folder to your images sprite path in your config:

sprite_load_path << "/shared/images"

chris

Gary

--
You received this message because you are subscribed to the Google Groups "Compass" group.
To view this discussion on the web visit https://groups.google.com/d/msg/compass-users/-/BxyC3_0tEAAJ.

Don Bowlby

unread,
Feb 23, 2014, 11:49:13 AM2/23/14
to compas...@googlegroups.com
I know this is a relatively old thread but just in case someone is having the same problem and finds this thread, this worked perfectly for me.


See post by gridlock that talks about editing sprite_importer.rb

The edits they're talking about can be found here:

Reply all
Reply to author
Forward
0 new messages