Professional Web Applications Themes

RubyCocoa problem: No such file to load -- osx/objc/cocoa - Ruby

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 ...

  1. #1

    Default 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.

    Ralph Pöllath Guest

  2. #2

    Default Re: RubyCocoa problem: No such file to load -- osx/objc/cocoa


    > 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.
    I think RubyCocoa works for the Ruby 1.6.7 installed with Mac OS X and
    with the binary distribution of RubyCocoa, but I don't know if it works
    for all Mac OS X versions.
    > 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)
    You can track down the required directories and files on your system.
    These are 'osx/objc/cocoa.rb' and files referenced in 'cocoa.rb'. As I
    recall there is a copy in the Library/Frameworks/RubyCocoa directory or
    a subdirectory thereof. You can search your hard drive for 'cocoa.rb'
    and find it.

    Then you can either (1) reference the correct location in the Ruby
    programs requiring these files or (2) copy them to the location
    referenced in the Ruby programs requiring these files.

    Either way, once you do this, you'll get a real error referencing a
    missing Objective C superclass (or something like that, I forget all of
    the details). I have never gotten beyond that point.

    If you have better luck, I am sure there are several people who would
    be interested in hearing about it.

    Regards,

    Mark


    Mark Wilson Guest

  3. #3

    Default Re: RubyCocoa problem: No such file to load -- osx/objc/cocoa

    Hi,
    > Either way, once you do this, you'll get a real error referencing a
    > missing Objective C superclass (or something like that, I forget all
    > of the details). I have never gotten beyond that point.
    Right, I can avoid the LoadError by specifying the correct include path
    on the command line, but for some reason, class ObjcID seems not to be
    defined:

    $ ruby -r'rubycocoa' -e 'puts "OK"'
    OK
    $ ruby -r'rubycocoa' -r 'osx/cocoa' -e 'puts "OK"'
    /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12:in `require': No such
    file to load -- osx/objc/cocoa (LoadError)
    from /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12
    $ ruby
    -I/Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby
    -r'rubycocoa' -r 'osx/cocoa' -e 'puts "OK"'
    /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/
    objc/oc_object.rb:15: undefined superclass `ObjcID' (TypeError)
    from
    /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/
    objc/oc_all.rb:13:in `require'
    <snip>

    Cheers,
    -Ralph.


    Ralph Pöllath Guest

Similar Threads

  1. Python and ObjC
    By Wezzy in forum Mac Programming
    Replies: 3
    Last Post: September 16th, 05:48 PM
  2. Cocoa: problem dragging PDF image rep into Keynote slide
    By Eric Raas in forum Mac Programming
    Replies: 0
    Last Post: September 15th, 12:33 PM
  3. Cocoa Project + GMP Problem...
    By Mark Bee in forum Mac Programming
    Replies: 3
    Last Post: August 18th, 02:15 PM
  4. newbie cocoa file reading/writing files
    By Richard Humiston in forum Mac Programming
    Replies: 1
    Last Post: July 21st, 02:42 PM
  5. RubyCocoa 0.4.0 path [?] Issue
    By Stephyn Butcher in forum Ruby
    Replies: 1
    Last Post: July 11th, 06:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139