From: "Ralph Pöllath" Date: 2003-10-05T18:07:21+09:00 Subject: Re: RubyCocoa problem: No such file to load -- osx/objc/cocoa Hi, I'm trying to get RubyCocoa to work with ruby 1.8.0 on MacOS 10.2.8. I followed Simon's advice and unchecked libruby-static.a in the RubyCocoa framework project file. Then I reinstalled both RubyCocoa and ruby, but no go. The RubyCocoa tests still fail with the now familiar error message: > /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12:in `require': No > such file to load -- osx/objc/cocoa (LoadError) Unfortunately, I'm not very familiar with the C toolchain, and so far couldn't find out more about this problem. Can anyone help? Thanks in advance, -Ralph. Simon wrote: > I figured this out. Below is the email I sent to the contact email for > RubyCocoa but I didn't get any reply. Anyway, all you need do is open > the Framework project file in ProjectBuilder and clear the linking of > libruby-static by deselecting the check box. But this does mean that > when you build apps you will need to explicity link in libruby-static. > Hope this helps. > ... > The problem was that libruby-static got linked twice: once with ruby > and once with the RubyCocoa framework. This meant that each got their > own versions of the global variables defined in libruby-static - the > problem being the variable rb_load_path - you prepend the Framework > path to this in RBRuntime.m but because libruby-static was linked into > RubyCocoa framework the newly prepended directory only goes on that > copy of rb_load_path - not the rb_load_path used in the ruby > interpreter. I fixed this (eventuallY - when I found the reasons) by > removing the link of libruby-static in the framework project files. > This worked fine - but it means that when applications are built and > linked with the framework you also need to link libruby-static (an > extra lib on the link line) > ... > > Barry Shultz wrote: > Hi, >> Pardon the attachment, but this issue has been brought up before with >> no >> resolution (that I know of), so I have tried to include any possibly >> relevant info in the attached file. >> I have been unable to get RubyCocoa to work with Ruby 1.8 on OS X (I >> did >> not try to get it running with the pre-installed 1.6.7, because of >> problems with Array#pack that I brought up last week on the ML). >> At the end of the attached file, you'll see that RubyCocoa does not >> successfully run its unit tests, and I get the error shown in the >> subject. I have tried to include all relevant information about my OS >> and my install of RubyCocoa. >> I would be happy to provide any other information, if someone will >> help >> me solve this one.