Compass / compass

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
http://compass-style.org
Other
6.72k stars 1.18k forks source link

no implicit conversion of Array into String - error using sprite-map with Ruby 2.2.0 #1933

Open paultibbetts opened 9 years ago

paultibbetts commented 9 years ago

Hi, I'm getting the following error when trying to run compass watch on a project I've inherited:

>>> Compass is watching for changes. Press Ctrl-C to Stop.
    error /Users/paul/Sites/xxxxxx/assets/sass/styles.scss (/Users/paul/.rvm/gems/ruby-2.2.0/gems/compass-1.0.3/lib/compass/sass_extensions/sprites/image.rb:24:in `basename': no implicit conversion of Array into String)

however unlike this issue I do have a relative path set.

The line that seems to be causing the error is:

$sprites: sprite-map("sprites/*.png", $spacing: 10px, $layout: horizontal); // import 1x sprites

The image path has been set in config.rb as images_dir = "img" and the sprites folder is found in assets/img/sprites

I'm using Ruby 2.2.0, Compass 1.0.3 and Sass 3.4.11.

Any ideas what the problem is?

Thanks, Paul

paultibbetts commented 9 years ago

Update I've rolled back to Ruby 2.1.0 and I'm no longer getting the error.

ettiennegous commented 9 years ago

I had the same issue while trying to run a compass compile from Gulp. (This was after converting it from native Compass compile) Adding the "relative_assets: true" option to the compass gulp command fixed my issue.

.pipe(compass({
                    //style:'compact',
                    comments: false,
                    css: taskName.cssTo,
                    sass: taskName.cssFrom,
                    image: taskName.img,
                    font: taskName.fonts,
                    debug: false,
                    logging: false, 
                    showStack: false, 
                    relative_assets: true, 
                    line_comments: false
                }))
evonsdesigns commented 8 years ago

I get this error when I try to do a grunt build in git bash. It works fine when I do it in command prompt. Sass 3.4.22 Compass 1.0.3 Ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]

SampathDilhan commented 7 years ago

I had a similar issue with Windows PowerShell. As mentioned by @evonsdesigns it works fine with the command prompt.

lucasluca commented 7 years ago

using windows prompt command it worked! Thanks a lot!