指南针0.12中的精灵错误/问题

3

有某些原因导致了本地故障。即使回滚到旧版本的代码库,仍然无法解决此问题。删除整个 repo、重新克隆它、卸载 compass、重新安装等操作也无法排除错误。

mycomputer:myproject(master) me$ compass watch --trace
>>> Change detected at 14:13:14 to: app/app.sass
remove assets/images/sprites-sf0f45583b2.png
NoMethodError on line ["24"] of /Users/me/.rvm/gems/ruby-1.9.3-p194/gems/chunky_png-1.2.5/lib/chunky_png/chunk.rb: undefined method `unpack' for nil:NilClass
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/chunky_png-1.2.5/lib/chunky_png/datastream.rb:78:in `from_io'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/chunky_png-1.2.5/lib/chunky_png/datastream.rb:66:in `block in from_file'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/chunky_png-1.2.5/lib/chunky_png/datastream.rb:66:in `open'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/chunky_png-1.2.5/lib/chunky_png/datastream.rb:66:in `from_file'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/chunky_png-1.2.5/lib/chunky_png/canvas/png_decoding.rb:53:in `from_file'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb:15:in `block in construct_sprite'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb:14:in `each'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb:14:in `construct_sprite'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/sprites/sprite_methods.rb:62:in `generate'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/functions/sprites.rb:122:in `sprite_url'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/sprites/sprite_map.rb:72:in `method_missing'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/sprites/sprite_map.rb:63:in `to_s'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/script/list.rb:44:in `block in to_s'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/script/list.rb:44:in `map'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/script/list.rb:44:in `to_s'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:238:in `visit_prop'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `map'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:29:in `block in visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:41:in `with_environment'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:28:in `visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `block in visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:259:in `visit_rule'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `map'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:29:in `block in visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:41:in `with_environment'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:28:in `visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `block in visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:125:in `visit_if'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:128:in `visit_if'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `block in visit_import'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `map'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `visit_import'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `block in visit_import'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `map'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `visit_import'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `block in visit_import'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `map'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:146:in `visit_import'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `map'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:53:in `visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:29:in `block in visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:41:in `with_environment'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:28:in `visit_children'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `block in visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:49:in `visit_root'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:20:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/visitors/perform.rb:7:in `visit'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/tree/root_node.rb:20:in `render'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/engine.rb:308:in `_render'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.0.alpha.237/lib/sass/engine.rb:255:in `render'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:140:in `block (2 levels) in compile'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:126:in `timed'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:139:in `block in compile'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/logger.rb:45:in `red'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:138:in `compile'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:118:in `compile_if_required'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:103:in `block (2 levels) in run'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:101:in `each'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:101:in `block in run'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:126:in `timed'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/compiler.rb:100:in `run'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/watch_project.rb:147:in `recompile'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/watch_project.rb:68:in `perform'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/base.rb:18:in `execute'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/project_base.rb:19:in `execute'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:30:in `block in <top (required)>'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:44:in `call'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:44:in `<top (required)>'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `load'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `<main>'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
LoadError on line ["70"] of /Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/watch_project.rb: cannot load such file -- fssm
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/watch_project.rb:70:in `perform'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/base.rb:18:in `execute'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/commands/project_base.rb:19:in `execute'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:30:in `block in <top (required)>'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:44:in `call'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:44:in `<top (required)>'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `load'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `<main>'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
3个回答

2
我遇到了类似的问题。为了复制这个问题,我下载了一个来自iconmostr的图标,并将其包含在我的sprites文件夹中。我得到了相同的错误。重启后,仍然出现同样的错误。
解决问题的方法是用Photoshop[CS5.5]打开该图标,并将其重新保存为“无”交错的.png格式。
图像元数据显示软件为“Adobe ImageReady”,并且重新导出的文件中没有Profile Name(重新导出时为sRGB IEC61966-2.1),DPI(重新导出时为72)或Type(重新导出时为PNGf)。
希望这能有所帮助。

1
我也遇到了这个问题,它是由图像中的异常数据引起的。
optipng the_pic 报告了错误 (Extraneous data found after IEND)
optipng -fix the_pic 解决了问题,compass编译顺利完成。
附言:我没有Photoshop,错误的图片来自我的设计师的Photoshop(我猜是5.0)......似乎在导出时出了点问题。

在Mac上,我用ImageOptim(http://imageoptim.com/)解决了相同的问题(它捆绑了optipng)。 - voidstate

0

我明白了。对我来说,问题是由于Gemfile中没有包含Compass gem引起的。所以我只需添加:

gem 'compass'

问题已经消失了。错误信息对于意识到这个问题真的没有什么帮助。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接