# RubyCocoa 0.4.0 path \[?\] Issue

**URL:** <https://rubytalk.org/t/rubycocoa-0-4-0-path-issue/6798>\
**Category:** ruby-talk\
**Created:** [11 July 2003 04:03 UTC](https://rubytalk.org/t/rubycocoa-0-4-0-path-issue/6798 "2003-07-11T04:03:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephyn\_Butcher](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Stephyn\_Butcher](https://rubytalk.org/u/Stephyn_Butcher)\
**Post date:** [11 July 2003 04:03 UTC](https://rubytalk.org/t/rubycocoa-0-4-0-path-issue/6798/1 "2003-07-11T04:03:50Z")

</div>

Any Mac OS X/Ruby users out there?

Okay…I like the command line but I’m itching for a GUI.

I’m using Mac OS X 10.2.6 and Ruby 1.6.8 (compiled from source). I just  
compiled RubyCocoa 0.4.0 from source and even though I applied the  
patch to take care of the Segmentation Fault problem, there still seems  
to be a greater problem with RubyCocoa finding individual bundles. For  
example, the test suite quits with:

[me@computer:~/Desktop/rubycocoa-0.4.0/tests]$DYLD\_FRAMEWORK\_PATH=/  
Users/stephyn/Desktop/rubycocoa-0.4.0/framework/build r  
uby -I…/lib testall.rb  
…/lib/osx/cocoa.rb:12:in `require': No such file to load -- osx/objc/cocoa (LoadError) from ../lib/osx/cocoa.rb:12 from ./tc_nsattributedstring.rb:12:in`require’  
from ./tc\_nsattributedstring.rb:12  
from testall.rb:4:in `require' from testall.rb:4 from testall.rb:3:in`each’  
from testall.rb:3  
Loaded suite testall  
Started

Finished in 0.002562 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

Similarly, attempting to run any other of the sample scripts fails with  
similar results. Generally, anything osx/? can’t be found. For example,

[me@computer:/Developer/Examples/RubyCocoa]$ruby sndplay.rb  
/usr/local/lib/ruby/site\_ruby/1.6/osx/cocoa.rb:12:in `require': No such file to load -- osx/objc/cocoa (LoadError) from /usr/local/lib/ruby/site_ruby/1.6/osx/cocoa.rb:12 from sndplay.rb:1:in`require’  
from sndplay.rb:1

This seems to be a known issue. I was curious if anyone had found a  
fix. I’m also posting to rubycocoa-talk but there doesn’t seem to be  
much traffic on that list.

Thanks in advance.  
Steve

---

<div class="post-metadata">

**Author:** ![FUJIMOTO\_Hisakuni](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@FUJIMOTO\_Hisakuni](https://rubytalk.org/u/FUJIMOTO_Hisakuni)\
**Post date:** [11 July 2003 06:55 UTC](https://rubytalk.org/t/rubycocoa-0-4-0-path-issue/6798/2 "2003-07-11T06:55:47Z")

</div>

You should check the following:

a0 = $:.dup  
require ‘rubycocoa’  
p $: - a0

The file “osx/objc/cocoa.rb” should exist in the result directory.

I guess that rubycocoa.bundle or RubyCocoa.framework is broken,  
because “ruby install.rb setup” has failed. If so, I don’t know  
why it failed. Did you check an error of the log when setup-phase?

regards,

> **···**
>
> At Fri, 11 Jul 2003 13:03:50 +0900, Stephyn Butcher wrote:
> 
> > Similarly, attempting to run any other of the sample scripts fails with  
> > similar results. Generally, anything osx/? can’t be found. For example,
> > 
> > [me@computer:/Developer/Examples/RubyCocoa]$ruby sndplay.rb  
> > /usr/local/lib/ruby/site\_ruby/1.6/osx/cocoa.rb:12:in `require': No such file to load -- osx/objc/cocoa (LoadError) from /usr/local/lib/ruby/site_ruby/1.6/osx/cocoa.rb:12 from sndplay.rb:1:in `require’  
> > from sndplay.rb:1
> 
> –  
> FUJIMTO Hisakuni

---

<div class="post-metadata">

**Author:** ![Stephyn\_Butcher](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Stephyn\_Butcher](https://rubytalk.org/u/Stephyn_Butcher)\
**Post date:** [11 July 2003 15:08 UTC](https://rubytalk.org/t/rubycocoa-0-4-0-path-issue/6798/3 "2003-07-11T15:08:14Z")

</div>

Thank you for your reply.

There are details below of some experiments I ran this morning. I’m  
still not having any luck. If you wish, I can send you more detailed  
output directly.

> > Similarly, attempting to run any other of the sample scripts fails  
> > with  
> > similar results. Generally, anything osx/? can’t be found. For  
> > example,
> > 
> > [me@computer:/Developer/Examples/RubyCocoa]$ruby sndplay.rb  
> > /usr/local/lib/ruby/site\_ruby/1.6/osx/cocoa.rb:12:in `require': No such file to load -- osx/objc/cocoa (LoadError) from /usr/local/lib/ruby/site_ruby/1.6/osx/cocoa.rb:12 from sndplay.rb:1:in `require’  
> > from sndplay.rb:1
> 
> You should check the following:
> 
> a0 = $:.dup  
> require ‘rubycocoa’  
> p $: - a0
> 
> The file “osx/objc/cocoa.rb” should exist in the result directory.

This is an empty array.

> I guess that rubycocoa.bundle or RubyCocoa.framework is broken,  
> because “ruby install.rb setup” has failed. If so, I don’t know  
> why it failed. Did you check an error of the log when setup-phase?

Is there a specific error log file somewhere or will there only be an  
error message on the console that the build failed or that some other  
error occurred?

I _was_ able to run SimpleApp.app as described but I don’t know if this  
is means everything else compiled or installed properly.

After looking at the directions for 1.6.7/1.8.0p3 installations, I  
realized that I probably did not have the right options RubyCocoa set  
when I build 1.6.8 so I re-built libruby.a following the directions for  
1.6.7. This was successful.

$ rbhost=`ruby -r rbconfig -e "print Config::CONFIG['host']"`  
$ CFLAGS=‘-g -O2 -fno-common’ ./configure --prefix=/usr --host=$rbhost  
$ make  
$ make test  
$ ranlib libruby.a  
$ rubyarchdir=`ruby -r rbconfig -e 'print Config::CONFIG["archdir"]'`  
$ sudo install -m 0644 libruby.a $rubyarchdir

Next, following the instructions, I made RubyCocoa. First with:

$ ruby install.rb config

There was no error reported. Next:

$ ruby install.rb setup

There was an error reported at this point that I did not see last night  
and was unexpected given that I ran ranlib on libruby.a above.

DynamicLibrary.LinkUsingFileList  
/Users/stephyn/Documents/ruby/rubycocoa-0.4.0/framework/build/  
RubyCocoa.framework/Versions/A/RubyCocoa  
/usr/bin/gcc3 -o  
/Users/stephyn/Documents/ruby/rubycocoa-0.4.0/framework/build/  
RubyCocoa.framework/Versions/A/RubyCocoa  
“-L/Users/stephyn/Documents/ruby/rubycocoa-0.4.0/framework/build”  
“-L/usr/local/lib/ruby/1.6/powerpc-darwin6.6”  
“-F/Users/stephyn/Documents/ruby/rubycocoa-0.4.0/framework/build”  
-filelist  
/Users/stephyn/Documents/ruby/rubycocoa-0.4.0/framework/build/  
RubyCocoa.build/RubyCocoa.build/Objects-normal/LinkFileList  
“-framework” “Cocoa” “-lruby” “-arch” “ppc” “-Wl,-single\_module”  
“-dynamiclib” “-compatibility\_version” “1” “-current\_version” “1”  
“-undefined” “suppress” “-flat\_namespace” -install\_name “`echo "/Library/Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa" | /usr/bin/sed 's!//*!/!g'`”  
ld: table of contents for archive:  
/usr/local/lib/ruby/1.6/powerpc-darwin6.6/libruby.a is out of date;  
rerun ranlib(1) (can’t load from it)  
/usr/bin/libtool: internal link edit command failed  
…failed DynamicLibrary.LinkUsingFileList  
/Users/stephyn/Documents/ruby/rubycocoa-0.4.0/framework/build/  
RubyCocoa.framework/Versions/A/RubyCocoa …  
\*\* BUILD FAILED \*\*  
setup failed  
‘system pbxbuild’ failed  
try ‘ruby install.rb --help’ for usage  
$ sudo ranlib /usr/local/lib/ruby/1.6/powerpc-darwin6.6/libruby.a  
Password:  
$

Worked so I ran setup again:

$ruby install.rb setup

And the result was:

[snip]  
\*\* BUILD SUCCEEDED \*\*  
\<— framework  
—\> lib  
—\> lib/osx  
\<— lib/osx  
\<— lib  
—\> ext  
—\> ext/rubycocoa  
make  
gcc -fno-common -g -O2 -pipe -F…/…/framework/build -framework  
RubyCocoa -I. -I/usr/local/lib/ruby/1.6/powerpc-darwin6.6  
-I/Users/stephyn/Documents/ruby/rubycocoa-0.4.0/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  
-L/usr/local/lib/ruby/1.6/powerpc-darwin6.6 -L/usr/local/lib  
-F…/…/framework/build -framework RubyCocoa -o rubycocoa.bundle  
rubycocoa.o -lobjc  
ld: warning dynamic shared library: /usr/lib/libobjc.dylib not made a  
weak library in output with MACOSX\_DEPLOYMENT\_TARGET environment  
variable set to: 10.1  
ld: warning dynamic shared library: /usr/lib/libSystem.dylib not made a  
weak library in output with MACOSX\_DEPLOYMENT\_TARGET environment  
variable set to: 10.1  
\<— ext/rubycocoa  
\<— ext  
install.rb: setup done.  
[stephyn@kosmo:~/Documents/ruby/rubycocoa-0.4.0]$

I don’t remember this error from before, either the linking error  
(which should be better highlighted) or the 10.1 warning:

“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  
-L/usr/local/lib/ruby/1.6/powerpc-darwin6.6 -L/usr/local/lib  
-F…/…/framework/build -framework RubyCocoa -o rubycocoa.bundle  
rubycocoa.o -lobjc  
ld: warning dynamic shared library: /usr/lib/libobjc.dylib not made a  
weak library in output with MACOSX\_DEPLOYMENT\_TARGET environment  
variable set to: 10.1  
ld: warning dynamic shared library: /usr/lib/libSystem.dylib not made a  
weak library in output with MACOSX\_DEPLOYMENT\_TARGET environment  
variable set to: 10.1”

but it is a known bug in the December 2002 Development Tools Release  
and interferes with a number of other Ruby compilations (namely, eruby).

So I tried:

$ MACOS\_DEPLOYMENT\_TARGET=10.2  
$ ruby install.rb setup

And there were no errors reported:

[snip]  
\*\* BUILD SUCCEEDED \*\*  
\<— framework  
—\> lib  
—\> lib/osx  
\<— lib/osx  
\<— lib  
—\> ext  
—\> ext/rubycocoa  
make  
make: Nothing to be done for `all’.  
\<— ext/rubycocoa  
\<— ext  
install.rb: setup done.

The next step fails with the same error as before:

$DYLD\_FRAMEWORK\_PATH=‘~/Documents/ruby/rubycocoa-0.4.0/framework/build’  
ruby -I…/lib testall.rb  
…/lib/osx/cocoa.rb:12:in `require': No such file to load -- osx/objc/cocoa (LoadError) from ../lib/osx/cocoa.rb:12 from ./tc_nsattributedstring.rb:12:in `require’  
from ./tc\_nsattributedstring.rb:12  
from testall.rb:4:in `require' from testall.rb:4 from testall.rb:3:in `each’  
from testall.rb:3  
Loaded suite testall  
Started

Finished in 0.002569 seconds.

0 tests, 0 assertions, 0 failures, 0 errors  
$

Clearly something is still wrong but what “it” is, eludes me. I can  
send more detailed output if you wish to you directly.

Steve

> ## regards,
> 
> FUJIMTO Hisakuni

Steve

> **···**
>
> On Friday, July 11, 2003, at 02:55 AM, FUJIMOTO Hisakuni wrote:
> 
> > At Fri, 11 Jul 2003 13:03:50 +0900, \> Stephyn Butcher wrote:

---

<div class="post-metadata">

**Author:** ![FUJIMOTO\_Hisakuni](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@FUJIMOTO\_Hisakuni](https://rubytalk.org/u/FUJIMOTO_Hisakuni)\
**Post date:** [11 July 2003 16:53 UTC](https://rubytalk.org/t/rubycocoa-0-4-0-path-issue/6798/4 "2003-07-11T16:53:08Z")

</div>

In the previous mail, I intended to show the hint for your solving  
your problem by yourself.

It was clear that setup phase was failed and so the  
rubycocoa.bundle was corrupt. However, I’m sorry, it is too hard  
that I continue to diagnostic process with an interview like your  
home doctor by English.

If it’s difficult that you solve this problem by yourself, I  
recommend you to use bianry distribution of RubyCocoa and default ruby  
1.6.7 in OSX.

Thanks,

> **···**
>
> At Sat, 12 Jul 2003 00:08:14 +0900, Stephyn Butcher wrote:
> 
> > There are details below of some experiments I ran this morning. I’m  
> > still not having any luck. If you wish, I can send you more detailed  
> > output directly.
> 
> –  
> FUJIMOTO Hisakuni
