I have trouble with ruby.png I checked if I could use another picture jpeg but it it didnt work either. Is it a question of paths? gosu is installed but I dont really know where it is. I have something called “start commander with ruby” from previous ruby experiences.
Did you go through the Windows setup in the first chapter? You need to install the Developer Tools and the gosu gem in addition to having Ruby.
I did. The gems from the command prompt and devkit from the site.
What do you mean you have trouble with ruby.png? Do you get an error when you run your program? Or does the program run but you don’t see the image in the window? If you get an error, what does it say?
When I run the program in page17 I get the black screen with the self caption text. When I run the program with addition from page 20 I get a long error message (I try to run the program from sublime 3 with ctrl b:
initialize': While opening ruby.png, the following error occured: Det går inte att hitta filen (translation: file cannot be found).
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/gosu-0.11.0-x86-mingw32/lib/gosu/patches.rb:52:in initialize’
from C:/Users/fredrik/Desktop/Games/WhackARuby/WhackARuby_1/whack_a_ruby.rb:7:in initialize’
from C:/Users/fredrik/Desktop/Games/WhackARuby/WhackARuby_1/whack_a_ruby.rb:11:in '
[Finished in 1.1s]
Is the file ‘ruby.png’ in the WhackARuby_1 folder?
So, I was having the same problem as the original poster so I looked at the files. Not surprisingly, there are ruby and hammer pngs in all WhackARuby_x files as well as in the _starter file. I copied the two image files into the WhackARuby file the book, as I see it, instructs you to make inside the Games folder.
In other words the path name of the file the ruby and hammer are in is: D: Games\WhackARuby ——By the way the whack_a _ruby.rb that I made is also in the D: Games\WhackARuby folder.
Anyway, It worked. Hooray!