From: Nobuyoshi Nakada Date: 2008-12-19T17:26:56+09:00 Subject: [ruby-core:20693] Re: best way to handle $: when embedding ruby Hi, At Fri, 19 Dec 2008 04:34:22 +0900, Rolando Abarca wrote in [ruby-core:20665]: > I'm trying to embed ruby in an iPhone App, and so, I have to follow > apple rules: I can't just install it in /usr, it has to live inside my > app bundle (the app home). I have successfully included ruby, libruby- > static.a and a simple script works just fine. Is iPhone also Darwin? I don't know how it differs from OS X, now ruby 1.8 is pre-installed in /usr on OS X 10.5. > I'm concerned on how the $: global variable will be filled though, > because AFAIK it is created with compile-time static strings that will > not reflect the real directories in my app. So far, this is what I'm > doing: > > void init_ruby_stuff() { > ruby_init(); > > NSString *rubydir = [[NSBundle mainBundle] pathForResource:@"lib" > ofType:nil inDirectory:@"ruby"]; How can you get that directory in C? -- Nobu Nakada