RubyCocoa and libxml-ruby-0.3.6

On Mar 8, 2006, at 7:53 PM, John N. Alegre wrote:

Daniel,

I would strongly encouage you to do this. They are pretty good.
Looking at
the various threads I am seeing about 50 percent of people who fail
in the
install of RubyCocca with DP and all of them have to do with the
ruby-libxml stuff. I wonder why it is a some do some dont?

They accepted the port. You may now install ruby-libxml with “port
install rb-libxml2” (don’t forget to sync, or selfupdate).

– Daniel

John N. Alegre [email protected] wrote:

Did you tell them to include this in the dependencies for RubyCocoa?

why ? this is not a rubycocoa dependency ?

Daniel H. [email protected] wrote:

They accepted the port. You may now install ruby-libxml with “port
install rb-libxml2” (don’t forget to sync, or selfupdate).

ok thanks very much.

no prob if i’ve allready installed ruby-libxml “by hand” ?

Daniel H. [email protected] wrote:

Maybe, did you install using DP ruby?

yes, it appears first in my PATH.
which ruby gives the SAME ruby now under :

RubyCocoa/XCode
Terminal
TextMate

i’m really happy about that.

If DP complains remove /opt/
local/lib/ruby/vendor_ruby/1.8/powerpc-darwin*/xml/.

I would also suggest getting rid of your /usr/local ruby. Less
versions, less complexity.

right i’ll rm -rf this stuff…

Make sure /opt/local/bin is in your PATH
before /usr/bin so you never use the Apple supplied ruby again.

no prob, verfied yet

Apart from that, i can’t install ruby-libxml at this time because i
can’t sunc or selfupdate any more (i think my network connection is slow
right now).

here is my trial :

sudo port sync
Error: /opt/local/bin/port: port sync failed: sync failed doing rsync
sudo port selfupdate
Error: /opt/local/bin/port: selfupdate failed: Couldnt sync dports tree:
sync failed doing rsync

On Mar 9, 2006, at 5:38 PM, Une bévue wrote:

ok thanks very much.

no prob if i’ve allready installed ruby-libxml “by hand” ?

Maybe, did you install using DP ruby? If DP complains remove /opt/
local/lib/ruby/vendor_ruby/1.8/powerpc-darwin*/xml/.

I would also suggest getting rid of your /usr/local ruby. Less
versions, less complexity. Make sure /opt/local/bin is in your PATH
before /usr/bin so you never use the Apple supplied ruby again.

On Mar 9, 2006, at 2:23 PM, John N. Alegre wrote:

Did you tell them to include this in the dependencies for RubyCocoa?

RubyCocoa does not depend on libxml, so it should not be a dependency.

– Daniel

On Mar 9, 2006, at 6:28 PM, Une bévue wrote:

Apart from that, i can’t install ruby-libxml at this time because i
can’t sunc or selfupdate any more (i think my network connection is
slow
right now).

The latest Apple security update broke rsync. Do a port install rsync
or:
remove /opt/local/var/db/dports/sources/
rsync.rsync.darwinports.org_dpupdate_dports/ and sync.

right i’ll rm -rf this stuff…

You can also pass the -f (force) flag to DP when you install:
port -f install …

– Daniel

Daniel H. [email protected] wrote:

The latest Apple security update broke rsync. Do a port install rsync
or:
remove /opt/local/var/db/dports/sources/
rsync.rsync.darwinports.org_dpupdate_dports/ and sync.

ok done that works right now

right i’ll rm -rf this stuff…

You can also pass the -f (force) flag to DP when you install:
port -f install …

i’m doing :
sudo port install rb-libxml2

i’ve seen that dp install first another libxml2

ok job finished i did a small test, seems to be ok.

i have to say something about my previous libxml2 install (i’ve
installed it because i didn’t know it’s standard on Tiger).

i had used the combo bersion (1 or 2 monthes ago) :
GnomeLibXmlCombo-2005-11-06

giving :
libexslt.framework
libxml.framework
libxslt.framework
xmllint
xsltproc

the frameworks are installed in /Library/Frameworks

i’ve repackaged this afternoon a RubyCocoa app making use of
ruby-libxml.

that works on my computer however a tester had a crash with this message
:

dyld: Library not loaded: @executable_path/…/Frameworks/
libxml.framework/Versions/2.6.22/libxml

this that means, the version of libxml2 i had, before reinstalling
everything using dp, was linked to this libxml2-combo version ?

and now, with the newest libxml2 installed by dp, would one of my
testers have the same kind of prob ?

On Mar 9, 2006, at 7:43 PM, Une bévue wrote:

xmllint

dyld: Library not loaded: @executable_path/…/Frameworks/
libxml.framework/Versions/2.6.22/libxml

this that means, the version of libxml2 i had, before reinstalling
everything using dp, was linked to this libxml2-combo version ?

and now, with the newest libxml2 installed by dp, would one of my
testers have the same kind of prob ?

libxml-ruby installed from DP will depend and install:
* libxml2
* zlib
* libiconv

To verify this, use the otool command.

$ otool -L /opt/local/lib/ruby/vendor_ruby/1.8/powerpc-darwin8.3.0/
xml/libxml.bundle
/opt/local/lib/ruby/vendor_ruby/1.8/powerpc-darwin8.3.0/xml/
libxml.bundle:
/opt/local/lib/libruby.dylib (compatibility version 1.8.0,
current version 1.8.4)
/opt/local/lib/libxml2.2.dylib (compatibility version 9.0.0,
current version 9.22.0)
/opt/local/lib/libiconv.2.dylib (compatibility version
6.0.0, current version 6.0.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0,
current version 1.2.3)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 88.1.5)
/opt/local/lib/libdl.1.dylib (compatibility version 1.0.0,
current version 1.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0,
current version 227.0.0)
/usr/lib/libmx.A.dylib (compatibility version 1.0.0, current
version 92.0.0)

You can change these using the install_name_tool. So when you package
your app, you would do:

$ install_name_tool -change /opt/local/lib/libxml2.2.dylib /usr/lib/
libxml2.2.dylib MyRubyApp.app/Contents/Frameworks/libxml.bundle

And now the packaged ruby-libxml depends on the Apple supplied
libxml2 (change the other ones, too). If for some reason you wanted
to package DP libxml2 (I don’t recommend it):

$ install_name_tool -change /opt/local/lib/libxml2.2.dylib
@executable_path/…/Frameworks/libxml2.2.dylib MyRubyApp.app/Contents/
Frameworks/libxml.bundle
where you copy the DP libxml2 to your application bundle.

I haven’t really used ruby cocoa much, you may want to check what
RubyApp.app/Contents/MacOS/whatever depends on (using otool -L again)
just to be sure you aren’t depending on anything in /opt/local,
because base Mac OS X install will not have those.

– Daniel

Daniel H. [email protected] wrote:

libxml-ruby installed from DP will depend and install: * libxml2 * zlib *
libiconv

To verify this, use the otool command.

$ otool -L /opt/local/lib/ruby/vendor_ruby/1.8/powerpc-darwin8.3.0/
xml/libxml.bundle

ok, fine :

otool -L
/opt/local/lib/ruby/site_ruby/1.8/powerpc-darwin8.5.0/xml/libxml.bundle
/opt/local/lib/ruby/site_ruby/1.8/powerpc-darwin8.5.0/xml/libxml.bundle:
/usr/lib/libxslt.1.dylib (compatibility version 3.0.0, current version
3.11.0) /usr/lib/libxml2.2.dylib (compatibility version 9.0.0, current
version 9.16.0) /opt/local/lib/libz.1.dylib (compatibility version
1.0.0, current version 1.2.3) /usr/lib/libSystem.B.dylib (compatibility
version 1.0.0, current version 88.1.5) /opt/local/lib/libiconv.2.dylib
(compatibility version 6.0.0, current version 6.0.0)
/opt/local/lib/libruby.dylib (compatibility version 1.8.0, current
version 1.8.4) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0,
current version 227.0.0)

then some are depending on /usr/lib others /opt/local/lib

with my app i had : > otool -L
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/lib/xml/libxml.bundle
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/lib/xml/libxml.bundle: /usr/lib/libxslt.1.dylib (compatibility
version 3.0.0, current version 3.11.0) /usr/lib/libxml2.2.dylib
(compatibility version 9.0.0, current version 9.16.0)
@executable_path/…/lib/libz.1.dylib (compatibility version 1.0.0,
current version 1.2.3) /usr/lib/libSystem.B.dylib (compatibility version
1.0.0, current version 88.1.5) @executable_path/…/lib/libiconv.2.dylib
(compatibility version 6.0.0, current version 6.0.0)
@executable_path/…/lib/libruby.dylib (compatibility version 1.8.0,
current version 1.8.4) /usr/lib/libobjc.A.dylib (compatibility version
1.0.0, current version 227.0.0)

here i see the “@executable_path/…/lib/libz.1.dylib” and libz.1.dylib
is effectively in …/lib, the same applies for libiconv.2.dylib,
libruby.dylib …

You can change these using the install_name_tool. So when you package your
app, you would do:

$ install_name_tool -change /opt/local/lib/libxml2.2.dylib /usr/lib/
libxml2.2.dylib MyRubyApp.app/Contents/Frameworks/libxml.bundle

And now the packaged ruby-libxml depends on the Apple supplied libxml2
(change the other ones, too).

ok, after doing that, for all the dylib being @executable_path, i get :
otool -L
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/lib/xml/libxml.bundle
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/lib/xml/libxml.bundle: /usr/lib/libxslt.1.dylib (compatibility
version 3.0.0, current version 3.11.0) /usr/lib/libxml2.2.dylib
(compatibility version 9.0.0, current version 9.16.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version
1.2.3) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 88.1.5) /usr/lib/libiconv.2.dylib (compatibility version 6.0.0,
current version 6.0.0) /usr/lib/libruby.dylib (compatibility version
1.8.0, current version 1.8.4) /usr/lib/libobjc.A.dylib (compatibility
version 1.0.0, current version 227.0.0)

everything being in /usr/lib

to be sure you aren’t depending on anything in /opt/local, because base
Mac OS X install will not have those.

i’ll do that in order to find which bundle is depending of :

@executable_path/…/Frameworks/ libxml.framework/Versions/2.6.22/libxml

ok i’ve seen which one is depending from libxml framework, that’s my
executable itself ))

otool -L
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/MacOS/BookmarksMerge
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/MacOS/BookmarksMerge:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 11.0.0)
@executable_path/…/Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa
(compatibility version 1.0.0, current version 1.0.0)
@executable_path/…/Frameworks/libxml.framework/Versions/2.6.22/libxml
(compatibility version 1.0.0, current version 1.0.0)
@executable_path/…/Frameworks/libxslt.framework/Versions/1.1.15/libxslt
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
88.1.5)

certainly because i’ve let those frameworks (libxml.framework and
libxslt.framework) in my XCode setup.

changing that in xcode, repacking the app gaves :

otool -L
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/MacOS/BookmarksMerge
/Users/yvon/work/RubyCocoa/BookmarksMerge/dist/BookmarksMerge.app/Conten
ts/MacOS/BookmarksMerge:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 11.0.0)
@executable_path/…/Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
88.1.5)

which is correct afaik.

thanks a lot for your help. – une bévue