Women in Technology

Hear us Roar



Article:
  An Introduction to RubyCocoa, Part 2
Subject:   Installer grief
Date:   2004-10-26 04:51:21
From:   Snarke
I just keep hating Unix more.


OK, so the XCode from this article won't compile, giving the error "/Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/oc_import.rb:22:in `module_eval': undefined method `NSClassFromString' for OSX:Module (NameError)"


Oh, neat. But maybe it's a problem witn Ruby 1.6.8? OK, I will install Ruby 1.8.1. Now, to my way of thinking, the *stupidest* place to put anything on a Mac is in an invisible folder, so when Ruby 1.8.1 leapt for /usr/local/lib, I reinstalled it into /Library/Ruby, where it belongs.


Then I had to find /usr/bin/ruby and rename it, because 1.6.8 was in front of 1.8.1.


OK, I'm finally getting "ruby 1.8.1 (2003-12-25) [powerpc-darwin]" when I type "ruby -v"


I close and open my XCode app. Nope, still won't compile. Same error. I clean all targets. Same error.


I attempt to reinstall Rubycocoa. I can't. Re-entering "ruby install.rb config" gets me "install.rb:47:in `require': No such file to load -- rbconfig (LoadError)
from install.rb:47
"


I put a link to /Library/Ruby/lib/ruby in /usr/lib/ruby. Nope. I erase my rubycocoa installer directory, and start over with the mysterious, unexplained sequence of commands that starts with CVS. Nope. I look inside "install.rb". There's a --help command, but it's broken; I can't get it to admit there's a way to tell it what the install prefix is, since it fails before getting to that part.


So I reinstall Ruby 1.8.1 with the defaults. NOW I can get the RubyCocoa installer to barf up its --help options. I point it at /Library/Ruby.


This changes the XCode error from "....(NameError)" to "....(NoMethodError)" Everything else is identical. OK, let's reinstall Ruby 1.8.1 back where it belongs, into Library, and clean the targets in XCode. Nope, still NoMethod.


The last time an installer program told me I could tell it where I wanted it to go, then malfunctioned wildly if I was presumptious enough to select anything other than the default, was Windows NT4. (Although the OSX Software Update control panel is completely unable to comprehend the idea that you might put an Application in a subfolder....)


Am I having fun yet?

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • Installer grief
    2004-11-07 18:22:59  Christopher Roach | O'Reilly Blogger [View]

    Ok, first, let me begin by saying that I am really sorry that you're having so much trouble trying to get everything working on your system. Also, I would like to apologize for such a long delay in getting back to you, but I have been out of town for business for a while and just recently got a chance to go back through all my missed emails and so forth.

    Murphy's Law normally seems to work against me. So, normally if anything can go wrong with an install it will happen to me, but for some reason once I switched to the CVS version of RubyCocoa, it installed without any problems whatsoever. This is nice, since software should never be hard, but it puts me at a bit of a disadvantage when trying to answer your questions since I never ran into these problems.

    I did look up your problem on the RubyCocoa-talk forum on Sourceforge.net and found an exact match with the following as their answer:


    RubyCocoa requires /usr/bin/cpp3 in "ruby install.rb config". If your
    Mac doesn"t have /usr/bin/cpp3, rubycocoa that you build would be broken.

    Please install gcc3.1 from XcodeTools1.5 to install /usr/bin/cpp3.


    Try out their solution, hopefully that will solve your problem. If not, post back here again and I will see what else I can find.

    Thanks for reading the article, and I hope this helps solve your problem.
    • Installer grief, continued.
      2005-04-28 14:48:28  Snarke [View]

      Didn't work.

      I've tried all sorts of things, including the rubycocoa-0.4.1.dmg magic installer program, which (it turns out) is hard-coded to install RubyCocoa into Ruby 1.6.7. Useless for Ruby 1.8.2, as everybody would seem to insist I run.

      Anyway, I have confirmed the presense of a /usr/bin/cpp3 file.
      > cpp3 --version
      cpp3 (GCC) 3.1 20021003 (prerelease)

      Now, at this point I really don't know what junk and garbage is still installed where from what, but I started over from the very beginning, in Part I of the article. Used CVS to get a brand-new copy of RubyCocoa-panther (0.4.1, devel-panther, release date of 2003-12-04)

      Built, installed, all that jazz. No error messages during Config. During Setup ("building framework target RubyCocoa without using any build style") it appears to have used /usr/bin/gcc-3.3 for compiling. It announced ** BUILD COMPLETED **. Then I find


      make
      gcc -fno-common -F../../framework/build -framework RubyCocoa -I. -I/usr/local/lib/ruby/1.8/powerpc-darwin7.5.0 -I/usr/local/lib/ruby/1.8/powerpc-darwin7.5.0 -I/Users/snarke/Personal/Programming/Ruby/rubycocoa-panther/ext/rubycocoa -c -o rubycocoa.o rubycocoa.m
      gcc: -framework: linker input file unused because linking not done
      gcc: RubyCocoa: linker input file unused because linking not done
      cc -dynamic -bundle -undefined suppress -flat_namespace -F../../framework/build -framework RubyCocoa -L"/usr/local/lib" -o rubycocoa.bundle rubycocoa.o -lruby -ldl -lobjc
      <--- ext/rubycocoa
      <--- ext
      install.rb: setup done.
      </pre>

      That doesn't look good to me, whatever it means. I run the Install phase, which doesn't generate any errors or warnings that I can see.

      I carry on, following the instructions for the RubyCocoaTar app exactly. The paragraph before "Adding The Guts" starts with the sentence "So, you've tried out your new RubyCocoa application and everything seems to be working fine so far, right?"

      Alas, no.


      [Session started at 2005-04-28 14:28:55 -0700.]
      /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/oc_import.rb:22:in `module_eval': undefined method `NSClassFromString' for OSX:Module (NoMethodError)
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/oc_import.rb:21:in `module_eval'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/oc_import.rb:21:in `ns_import'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/foundation.rb:5
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/cocoa.rb:11:in `require'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/cocoa.rb:11
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/cocoa.rb:11:in `require'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/cocoa.rb:11
      from /Users/snarke/Personal/Programming/My Programs/My Ruby Programs/RubyCocoaTar/build/RubyCocoaTar.app/Contents/Resources/rb_main.rb:9:in `require'
      from /Users/snarke/Personal/Programming/My Programs/My Ruby Programs/RubyCocoaTar/build/RubyCocoaTar.app/Contents/Resources/rb_main.rb:9

      Executable “RubyCocoaTar” has exited with status 1.


      Ruby is going to be nearly useless to me if I cannot put a decent interface on it. Sigh. I may have to resort to building AppleScript Studio apps that call Ruby command line modules. How sad is that?
      • Installer grief, concluded.
        2005-05-25 12:34:22  Snarke [View]

        The answer is I had the wrong RubyCocoa 0.4.1. I think in the CVS instructions in this article, where it says "rubycocoa-panther", is the killer. It needs to be not the '-panther' version, but the current 'real' version, in order to avoid the broken install. I don't understand CVS well enough to be sure.

        From the RubyCocoa-talk list:

        Although that VERSION says 0.4.1, it isn't the 0.4.1 release. You've checked out an old version of the code that was used for working on initial Panther support.

        The VERSION file for 0.4.1 release looks like this:


        VERSION = "0.4.1"
        STAGE = ""
        RELEASE_DATE = "2005-03-25"


        Probably easiest to go with the 0.4.1 source tar:

        http://prdownloads.sourceforge.net/rubycocoa/rubycocoa-0.4.1.tgz?download

    • Installer grief, continued.
      2005-04-28 14:45:35  Snarke [View]

      Didn't work.

      I've tried all sorts of things, including the rubycocoa-0.4.1.dmg magic installer program, which (it turns out) is hard-coded to install RubyCocoa into Ruby 1.6.7. Useless for Ruby 1.8.2, as everybody would seem to insist I run.

      Anyway, I have confirmed the presense of a /usr/bin/cpp3 file.
      > cpp3 --version
      cpp3 (GCC) 3.1 20021003 (prerelease)

      Now, at this point I really don't know what junk and garbage is still installed where from what, but I started over from the very beginning, in Part I of the article. Used CVS to get a brand-new copy of RubyCocoa-panther (0.4.1, devel-panther, release date of 2003-12-04)

      Built, installed, all that jazz. No error messages during Config. During Setup ("building framework target RubyCocoa without using any build style") it appears to have used /usr/bin/gcc-3.3 for compiling. It announced ** BUILD COMPLETED **. Then I find


      make
      gcc -fno-common -F../../framework/build -framework RubyCocoa -I. -I/usr/local/lib/ruby/1.8/powerpc-darwin7.5.0 -I/usr/local/lib/ruby/1.8/powerpc-darwin7.5.0 -I/Users/snarke/Personal/Programming/Ruby/rubycocoa-panther/ext/rubycocoa -c -o rubycocoa.o rubycocoa.m
      gcc: -framework: linker input file unused because linking not done
      gcc: RubyCocoa: linker input file unused because linking not done
      cc -dynamic -bundle -undefined suppress -flat_namespace -F../../framework/build -framework RubyCocoa -L"/usr/local/lib" -o rubycocoa.bundle rubycocoa.o -lruby -ldl -lobjc
      <--- ext/rubycocoa
      <--- ext
      install.rb: setup done.
      </pre>

      That doesn't look good to me, whatever it means. I run the Install phase, which doesn't generate any errors or warnings that I can see.

      I carry on, following the instructions for the RubyCocoaTar app exactly. The paragraph before "Adding The Guts" starts with the sentence "So, you've tried out your new RubyCocoa application and everything seems to be working fine so far, right?"

      Alas, no.


      [Session started at 2005-04-28 14:28:55 -0700.]
      /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/oc_import.rb:22:in `module_eval': undefined method `NSClassFromString' for OSX:Module (NoMethodError)
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/oc_import.rb:21:in `module_eval'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/oc_import.rb:21:in `ns_import'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/foundation.rb:5
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/cocoa.rb:11:in `require'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/objc/cocoa.rb:11
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/cocoa.rb:11:in `require'
      from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/cocoa.rb:11
      from /Users/snarke/Personal/Programming/My Programs/My Ruby Programs/RubyCocoaTar/build/RubyCocoaTar.app/Contents/Resources/rb_main.rb:9:in `require'
      from /Users/snarke/Personal/Programming/My Programs/My Ruby Programs/RubyCocoaTar/build/RubyCocoaTar.app/Contents/Resources/rb_main.rb:9

      Executable “RubyCocoaTar” has exited with status 1.


      Ruby is going to be nearly useless to me if I cannot put a decent interface on it. Sigh. I may have to resort to building AppleScript Studio apps that call Ruby command line modules. How sad is that?