Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Problems with packaging the game into a portable executable
- - By ChaosBat Date 2015-08-09 09:59
I tried installing releasy via gem install releasy  and I keep having this error although ruby devkit is installed and that the PATH is set to the ruby directory
ERROR:  Error installing releasy:
The 'libxml-ruby' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from '' and follow the instructions
at ''

then I moved to ocra and it installed fine but It won't include the resources even when I pass the file paths to the resources in the command line, when I move the created executable to any other PC or any other
folder that isn't the root folder of the project it says it can't load images
this is what I pass to ocra:
ocra main.rb scripts/gameWindow.rb scripts/player.rb resources/backgrounds/bg_01.png resources/characters/char_01.bmp
but as I said it still doesn't include the resources (except the scripts which work fine)
I can provide code upon request
all help would be very appreciated
Parent - - By jlnr (dev) Date 2015-08-09 10:52
No idea about Releasy - especially since it seems to be more of a libxml installation issue than issue with Releasy itself.

Ocra: I suspect that Ocra does actually include the images. However when the game runs, they are not necessarily accessible from the current directory, so you will not be able to load them using a relative path like "resources/bg_01.png". One thing you can try is to add the --chdir-first option to the ocra call. (I'm not sure if that will set the current directory to the folder containing the EXE file, or to the temporary folder into which images are extracted, but it's worth a short.)
For further debugging you can log Dir.getwd or Dir['*'] to a file on the desktop to inspect what's going on, or pass --debug-extract to ocra and inspect which files are being included - see the README on GitHub:

Hope that helps.
Parent - By ChaosBat Date 2015-08-09 12:36
Thank you, the problem is solved now.
the --chdir-first option solved it. I did use relative paths in my project I suspect the problem was that ocra didn't set the directory containing the main.rb script as the root folder (which I think it was what the chdir-first option did) and that caused the paths to the resources not to behave correctly in the executable. also the debugger has shown that the resources were added even without the option which indicates that the problem was indeed in the paths.
p.s: I just checked out the releasy git repository and it appears that the last commit was pushed over a year ago (Oct, 22, 2014) I am not sure but maybe the project is outdated.
Up Topic Gosu / Gosu Exchange / Problems with packaging the game into a portable executable

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill