Hi, I've been away from the Gosu forums for a while. It's nice to be back. Greetings and best wishes to all.
My old Ubuntu installation stopped working a while back, so I didn't use Gosu for a year or two, and now I've tried installing Gosu again, and my old games don't seem to be working like they used to.
I have currently installed Gosu / Chingu on a PC with Windows 10, and my brother is helping me out by trouble-shooting the same issues on a newer MacBook, with OSX 10.10.
I keep getting the same error -- Undefined Method "to_blob". This seems to occur mostly with code looking like
@image = Gosu::Image.new(...) or similar.
Most of my old projects are affected. I have tried changing the gem versions of both Gosu and Chingu in the Gemfile, and I continue to get the same issue. Any ideas of what might be causing this? Included below is the stack trace from one of the broken games. They have pretty much all stopped working now. Any help will be appreciated. Thanks as always. Gosu is the greatest.
initialize': undefined method to_blob' for #<GameWindow:0x34c67e8> (NoMethodError)
block in setup'call'
block in update_trait'each'
from main.rb:136:in `<main>'
And here is the affected line of code from the above error log (lense_flare.rb:85):
@@star_flare = Gosu::Image.new window, File.join(load_path, 'star_flare.png')
UPDATE: I have been able to resolve the issue with images by changing the syntax, but I am having the same issue with Chingu Animations, and I have not been able to fix it so far.
UPDATE: I wonder if this might have to do with the Ruby version... Perhaps Chingu Animations are not compatible with newer versions of Ruby?...
What version of Gosu are you using?
0.9.0+ might break things in Chingu, does using an older version, such as 0.8.7 fix it?
The strange thing is that Chingu does not
alias any methods in
Gosu::Image (monkey-patching). It seems to only use the public interface.
Since Gosu 0.9 is supposed to be backwards-compatible, it might be a bug in Gosu. (But testing with 0.8.7 is still worth a shot!)
Thanks for the responses. I tried using various older versions of both Gosu and Chingu, with the same results, but I have not tried with an older version of Ruby yet. I will try with Ruby 1.9.3 and post the results when I get a chance.
I've dug into it and Chingu by itself seems to work - no problem with any of Chingu's examples (at least, the five I've tried) and Gosu 0.10.0.
However, Ashton monkey-patches a lot of stuff in Gosu, and that might be the problem at hand. I know that everything in Ashton should actually be part of Gosu...but right now I don't have the resources to either implement it in Gosu or to fix the Ashton gem. Sorry :|
I had a similar issue the other day using Chingu, Try naming you image file like this: filename_32x32.png. Where the 32x32 will be the width and height of the image. This worked for me.
Thank you for the suggestions. I will try these out as soon as I am able.
Oh man, in retrospect that was a really silly oversight on my part. Anyway, should be fixed in Gosu 0.10.4.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill