You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
psd.image.save_as_png 'example.png'
IOError: closed stream
from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/formatter.rb:191:in directory?' from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/formatter.rb:191:inawesome_file'
from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/formatter.rb:26:in format' from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/inspector.rb:137:inunnested'
from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/inspector.rb:104:in awesome' from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/core_ext/kernel.rb:10:inai'
from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/core_ext/kernel.rb:15:in ap' from /Users/bfoz/.rvm/gems/ruby-1.9.3-p448/gems/awesome_print-1.1.0/lib/awesome_print/inspector.rb:31:inoutput_value'
from /Users/bfoz/.rvm/rubies/ruby-1.9.3-p448/bin/irb:16:in `
'
The text was updated successfully, but these errors were encountered:
The reason it's still outputting an image is because it's an issue with the awesome_print gem, not PSD.rb. It looks like awesome_print is integrated into IRB such that it replaces the default printer. It's attempting to read the PNG file contents, but the file has been closed by ChunkyPNG, thus causing an error.
If you want to avoid the error in the console, you can do something like:
Saving example.psd to a PNG throws an error, however the image appears to be generated correctly despite the error. Error output is below.
Here's my ruby version:
09:32 bfoz@nancy-dt:test$ ruby --version
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]
Here's the error:
09:10 bfoz@nancy-dt:test$ irb
The text was updated successfully, but these errors were encountered: