This isn't completely
about Gosu, but I've been writing a simple Ruby graphics library (just for fun) (https://rubygems.org/gems/rubydraw
) based off of SDL, and I wanted to see how much it would take to be able to package it up into a nice little Mac App that could run on theoretically any
Mac. Everything is working fine and dandy, but currently the end user would have to have a few gems installed. I tried adding them to a subdirectory in Resources (entitled "Libraries"), then adding it to $LOAD_PATH. It still wouldn't work; it tries to load the gems from the gem folder. And I know it adds the completely correct directory to $LOAD_PATH; I had it print it once and it was fine. Anyone know how to do this?
This should work just fine. What do you mean by "gem folder"? Can you post the error message and $LOAD_PATH?
And this is the error message (backticks replaced with single quotes):
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in 'gem_original_require': no such file to load -- rubydraw (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in 'require'
from /Users/alanwostenberg/Desktop/HelloWorld/HelloWorld.app/Contents/MacOS/rubyapp:13:in 'require'
And finally, the structure of the package is attached.
Oh, I thought you'd use Gosu's wrapper app. I have no idea what you use for wrapping, but using system Ruby has only given me trouble...that's why I built the monolothic .app wrapper. But my wrapper does not understand gem folder structures either. I think you'd need to grok rubygems' internals and then mess with the "gem environment".
Oh, I wrote my own short Ruby script and marked it as an executable; that's that "rubyapp" thing. Yeah, it does just load whatever version of Ruby the user has as their default; it'd be nice to try to control that sort of thing. And I don't really want to package up an entire Ruby interpreter myself; it just takes up extra space, and Macs come with Ruby installed by default.
But I think that
gem environment thing is exactly what I need! Thanks; I'll check this out (the
GEM_HOME constant, specifically).
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill