Forum: Ruby RubyCocoa and libxml-ruby-0.3.6

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-07 20:31
(Received via mailing list)
i have two versions of Ruby with my computer, the default Tiger one
(1.8.2) and another one installed in /usr/local

i've buil recently RubyCocoa using the ruby in /ur/local

however, within XCode when i print out ruby --version, i still get the
Tiger's one (1.8.2)

then, following an advice given on RubyCocoa-talk i've installed also
libxml-ruby-0.3.6 for the Tiger's ruby.

each time i put a "require 'xml/libxml'" i my "rb_main.rb" file i get an
error saying this Tiger's ruby is unable to find that extension.

in order to install libxml-ruby-0.3.6 for the Tiger's ruby i had to
install also rubygems.

if i make a test, using Tiger's ruby, from the command line i get no
error the libray is found.

it is only when wanting to use it from XCode, in a RubyCocoa app i get
this error.

any idae ???
B2561fdd05855be51aca982c54eb9f81?d=identicon&s=25 John N. Alegre (Guest)
on 2006-03-07 20:46
(Received via mailing list)
Use DarwinPorts to install ruby which will put yet another ruby
in /opt/local/bin but this will be easy to keep updated, again with
DarwinPorts, then use DarwinPorts to install RubyCocoa.  It puts
everything
where it should be.

john
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-07 21:01
(Received via mailing list)
John N. Alegre <info@johnalegre.net> wrote:

> Use DarwinPorts to install ruby which will put yet another ruby
> in /opt/local/bin but this will be easy to keep updated, again with
> DarwinPorts, then use DarwinPorts to install RubyCocoa.  It puts everything
> where it should be.

obviously we could also rubygems with darwinports ?

i'll try taht asap thanks :-)
6a28ba6ec44cf691eb4f4d7d40e094e5?d=identicon&s=25 Craig Demyanovich (Guest)
on 2006-03-07 21:14
(Received via mailing list)
Une bévue wrote:
> obviously we could also rubygems with darwinports ?

I do, and it has worked very well.... Although, I haven't been able to
install libxml-ruby using RubyGems. It can't find the libiconv installed
by DarwinPorts. When I have some time to write up my problem, I'll post
it to the list.

Regards,
Craig
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-07 21:20
(Received via mailing list)
On Mar 7, 2006, at 9:12 PM, Craig Demyanovich wrote:

> Une bévue wrote:
>> obviously we could also rubygems with darwinports ?
>
> I do, and it has worked very well.... Although, I haven't been able
> to install libxml-ruby using RubyGems. It can't find the libiconv
> installed by DarwinPorts. When I have some time to write up my
> problem, I'll post it to the list.
>
> Regards,
> Craig

I made a libxml-ruby portfile for DarwinPorts. It has been in
bugzilla for about 2 weeks -- maybe I should start bugging them on
the mailing list. They also haven't looked at my mod_ruby update (all
it does it update the version and md5 checksum).

-- Daniel
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-07 21:45
(Received via mailing list)
Craig Demyanovich <demmer12@fastmail.us> wrote:

> I do, and it has worked very well.... Although, I haven't been able to
> install libxml-ruby using RubyGems.

unfortunately, this isn't my case ;-)

because, before to darwinports i had allready installed rubygems into
/opt/local i get the following error message at the activate step :
--->  Activating rb-rubygems 0.8.11_0
Error: Target com.apple.activate returned: Image error:
/opt/local/lib/ruby/gems/1.8/cache/sources-0.0.1.gem already exists and
does not belong to a registered port.  Unable to activate port
rb-rubygems.
Error: /opt/local/bin/port: Status 1 encountered during processing.

do you know some workaround ?
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-07 21:54
(Received via mailing list)
Une bévue <pere.noel@laponie.com.invalid> wrote:

> do you know some workaround ?

i did a :

rm -rf /opt/local/lib/ruby/gems

followed by a :

~/Darwinports%> sudo port install rb-rubygems
--->  Activating rb-rubygems 0.8.11_0
--->  Cleaning rb-rubygems


then everything, up to now, worked fine.
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-07 22:37
(Received via mailing list)
John N. Alegre <info@johnalegre.net> wrote:

> Use DarwinPorts to install ruby which will put yet another ruby
> in /opt/local/bin but this will be easy to keep updated, again with
> DarwinPorts, then use DarwinPorts to install RubyCocoa.  It puts everything
> where it should be.

i not sure about that, having done a complete re-install of ruby,
rubgems and rubycocoa i still get from my rb_main.rb where i've put :

def rb_main_init
  path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation
  rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x}
  rbfiles -= [ File.basename(__FILE__) ]
  which_ruby=`which ruby `.chomp
  p "#{which_ruby}"
  p `#{which_ruby} --version`
  p $LOAD_PATH
  rbfiles.each do |path|
    require( File.basename(path) )
  end
end


the print out is :

"/usr/bin/ruby"
"ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]\n"

still Tiger's ruby...

however the $LOAD_PATH is :
["/Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/BookmarksM
erge.app/Contents/Resources",
"/Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby",
"/opt/local/lib/ruby/site_ruby/1.8",
"/opt/local/lib/ruby/site_ruby/1.8/powerpc-darwin8.5.0",
"/opt/local/lib/ruby/site_ruby", "/opt/local/lib/ruby/vendor_ruby/1.8",
"/opt/local/lib/ruby/vendor_ruby/1.8/powerpc-darwin8.5.0",
"/opt/local/lib/ruby/vendor_ruby", "/opt/local/lib/ruby/1.8",
"/opt/local/lib/ruby/1.8/powerpc-darwin8.5.0", "."]


then again, again and again, ruby is tiger's one even the $LOAD_PATH of
it is the corect one : /opt/local/blahblah...

exactly what i've get before using a "handy" install...

something wrong, to me, here !
B2561fdd05855be51aca982c54eb9f81?d=identicon&s=25 John N. Alegre (Guest)
on 2006-03-07 23:34
(Received via mailing list)
Une,

Do you use any other ports?  How many?

/opt/local is ONLY used by DP so you have the option of blowing
away /opt/local (sudo rm -rf /opt/local) reinstalling ports and then
reinstalling any ports you use.

On the issue of your scripts still finding /usr/bin/ruby, it is
necessary to
put in your .pofile in your home directrory "export
PATH=/opt/local/bin:/opt/local/sbin:$path"
This will make ports found first.  If you use fink too do this AFTER you
call the fink script.

Good luck
john
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-08 08:41
(Received via mailing list)
John N. Alegre <info@johnalegre.net> wrote:

> Do you use any other ports?  How many?

no, only those related to ruby.

> /opt/local is ONLY used by DP so you have the option of blowing
> away /opt/local (sudo rm -rf /opt/local) reinstalling ports and then
> reinstalling any ports you use.

yes i know.

> On the issue of your scripts still finding /usr/bin/ruby, it is necessary to
> put in your .pofile in your home

i think you mean .profile ?
-------------------^-----

or, does exist a .portfile file ?
--------------------^^----

i think this has been done automatically by the Darwinports pkg :
> cat .profile
#
# Your previous .profile  (if any) is saved as .profile.dpsaved
# Setting the path for DarwinPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

> directrory "export
> PATH=/opt/local/bin:/opt/local/sbin:$path"
> This will make ports found first.  If you use fink too do this AFTER you
> call the fink script.

no i don't use fink.


BUT, i wonder about the useness of .profile, is this used by XCode ?
i don't think so.
also, i'm using zsh instead of bash as a shell.
my $PATH is obviously starting by /opt/local/bin :
> echo $PATH
/opt/local/bin:/usr/local/bin:/usr/local/mysql/bin:/bin:/usr/bin:/sbin:/
usr/sbin:/usr/X11R6/bin:/Users/yvon/bin:/Developer/qt/bin:/usr/local/pgs
ql/bin:/Users/yvon/bin/groovy/bin



my ruby scripts does have a shebang like that :

#!/usr/bin/env ruby -w

then, when launching a ruby script from Terminal i get the right ruby
according to the $PATH

all of those scripts are working correctly, from Terminal.

again, i don't think XCode nor RubyCocoa use this way to find ruby (thru
$PATH)

Jonathan Paisley (on RubyCocoa-talk mail-list) said something like "ruby
cocoa don't use /opt/local/bin/ruby" it finds that by $LOAD_PATH, which
is correct.

Finally may be it is MY way to print-out which ruby is in under use
being WRONG (from XCode /RubyCocoa) :
  which_ruby=`which ruby `.chomp
  p "#{which_ruby}"
  p `#{which_ruby} --version`
  p $LOAD_PATH


because i don't know, in the XCpde/RubyCocoa context, what's the SHELL
in use (i've set the $SHELL to /usr/local/bin/zsh.

to finish with, adding this line (after p $LOAD_PATH) in my rb_main.rb :
p `ruby --version`
i get :
"ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]\n"

now, i'll try, before (re)+ installing ruby and co, try a libxml binder
install by gem.
12271b6df73fe29930d65586be5a4a70?d=identicon&s=25 Dave Howell (Guest)
on 2006-03-08 09:27
(Received via mailing list)
On Mar 7, 2006, at 23:38, Une bévue wrote:

>
> BUT, i wonder about the useness of .profile, is this used by XCode ?
> i don't think so.

Nope. It only affects what you get when you type "ruby" at the command
line.

> again, i don't think XCode nor RubyCocoa use this way to find ruby
> (thru
> $PATH)

I had the same problem. Somebody told me to use DarwinPorts, but
happily, I didn't take their advice. The last thing I needed was yet
another install of Ruby in yet another location. I already had too many
installs as it was! {chuckle}

Look and see if you have too many RubyCocoa.framework files. I'll bet
you'll find one in /Library/Frameworks, AND one in
~/Library/Frameworks. Delete the one in your user Library, and XCode
should start finding the one you want.
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-08 09:45
(Received via mailing list)
Dave Howell <groups@grandfenwick.net> wrote:

> I had the same problem. Somebody told me to use DarwinPorts, but
> happily, I didn't take their advice. The last thing I needed was yet
> another install of Ruby in yet another location. I already had too many
> installs as it was! {chuckle}

i agree very much with you, the ruby Darwinports install is worst than
the "hand made".

the /opt/local/bin/gem is unable to find iconv (re-installed by dp) and
then fails to install ruby-libxml...

generally i avoid using dp nor fink...

> Look and see if you have too many RubyCocoa.framework files. I'll bet
> you'll find one in /Library/Frameworks, AND one in
> ~/Library/Frameworks. Delete the one in your user Library, and XCode
> should start finding the one you want.

i don't have a ~/Library/Frameworks even.
B2561fdd05855be51aca982c54eb9f81?d=identicon&s=25 John N. Alegre (Guest)
on 2006-03-08 15:33
(Received via mailing list)
Your making this much harder then needed.  If you use DP to install
RubyCocca then the stuff that XCode uses goes in the correct developer
directories and the bindings go in /opt/local.  This is all transparent
to
XCode!  The need for the $PATH changes only have to do with using ruby
from
a shell.

This has been posted to both this list and the DP list.

install ruby with DP
install RubyCocca with DP
use RubyCocca in XCode
done
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-08 15:52
(Received via mailing list)
On Mar 8, 2006, at 9:43 AM, Une bévue wrote:
>
> the /opt/local/bin/gem is unable to find iconv (re-installed by dp)
> and
> then fails to install ruby-libxml...
>
> generally i avoid using dp nor fink...


The DP ruby applies several patches to ruby so you get a full working
install. If you are having trouble installing ruby-libxml through
rubygems, than download the tar.gz package, and run extconf with the
--with-iconv-dir=/usr option, or you can wait until darwinports
accepts my Portfile for libxml-ruby. Managing packages without the
use of a package manager is a pain in the ass.

-- Daniel
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-08 16:04
(Received via mailing list)
John N. Alegre <info@johnalegre.net> wrote:

> Your making this much harder then needed.  If you use DP to install
> RubyCocca then the stuff that XCode uses goes in the correct developer
> directories and the bindings go in /opt/local.
i didn't said the contrary...
>  This is all transparent to
> XCode!  The need for the $PATH changes only have to do with using ruby from
> a shell.

i know that.

>
> This has been posted to both this list and the DP list.
>
> install ruby with DP
> install RubyCocca with DP
> use RubyCocca in XCode
> done

it's what i have done yesterday afternoon, however i was unable to
install libxml-ruby :
sudo gem install -r libxml-ruby
fails to :
ERROR:  While executing gem ... (RuntimeError)
    ERROR: Failed to build gem native extension.
Gem files will remain installed in
/opt/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.6 for inspection.

even if iconv has been installed by dp...


then i'm BACK exactly at the point where i was before yesterday
afternoon, it is even worst because now i'm no more able to install
libxml-ruby which was the ONLY reason for me to make a new ruby install
with dp...

before that dp install i was able to use libxml-ruby from terminal,
RubyCocoa failed on "require 'xml/libxml'".
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-08 16:26
(Received via mailing list)
Daniel Harple <dharple@generalconsumption.org> wrote:

> The DP ruby applies several patches to ruby so you get a full working
> install. If you are having trouble installing ruby-libxml through
> rubygems, than download the tar.gz package, and run extconf with the
> --with-iconv-dir=/usr option

fine thanks it works* using :

ruby ext/xml/extconf.rb --with-iconv-dir=/usr
make
sudo make install

and right now i've uncommented "require 'xml/libxml'" in my rb_main.rb
and i don't have any more crash about that, however i must test that
more deeply, this require works also from Terminal...

* using rake fails into :
~/Desktop/libxml-ruby-0.3.6%> rake
(in /Users/yvon/Desktop/libxml-ruby-0.3.6)
rm -r html
rm -r html
rm -r pkg
/usr/bin/ruby extconf.rb
can't find header files for ruby.
rake aborted!
Command failed with status (1): [/usr/bin/ruby extconf.rb]
/Users/yvon/Desktop/libxml-ruby-0.3.6/rakefile:40
(See full trace by running task with --trace)


then with trace :
~/Desktop/libxml-ruby-0.3.6%> rake --trace
(in /Users/yvon/Desktop/libxml-ruby-0.3.6)
** Invoke default (first_time)
** Invoke release (first_time)
** Invoke clobber (first_time)
** Invoke clean (first_time)
** Execute clean
rm -r cbg.o
rm -r libxml.o
rm -r ruby_xml_attr.o
rm -r ruby_xml_attribute.o
rm -r ruby_xml_document.o
rm -r ruby_xml_dtd.o
rm -r ruby_xml_input_cbg.o
rm -r ruby_xml_node.o
rm -r ruby_xml_node_set.o
rm -r ruby_xml_ns.o
rm -r ruby_xml_parser.o
rm -r ruby_xml_parser_context.o
rm -r ruby_xml_sax_parser.o
rm -r ruby_xml_schema.o
rm -r ruby_xml_tree.o
rm -r ruby_xml_xinclude.o
rm -r ruby_xml_xpath.o
rm -r ruby_xml_xpath_context.o
rm -r ruby_xml_xpointer.o
rm -r ruby_xml_xpointer_context.o
rm -r html
** Invoke clobber_doc (first_time)
** Execute clobber_doc
rm -r html
** Invoke clobber_package (first_time)
** Execute clobber_package
rm -r pkg
** Execute clobber
rm -r mkmf.log
rm -r Makefile
rm -r extconf.h
** Invoke update_version (first_time)
** Execute update_version
** Invoke compile (first_time)
** Invoke ext/xml/libxml.so (first_time)
** Invoke ext/xml/Makefile (first_time)
** Invoke ext/xml/extconf.rb (first_time, not_needed)
** Execute ext/xml/Makefile
/usr/bin/ruby extconf.rb
can't find header files for ruby.
rake aborted!
Command failed with status (1): [/usr/bin/ruby extconf.rb]
/usr/lib/ruby/site_ruby/1.8/rake.rb:567:in `sh'
/usr/lib/ruby/site_ruby/1.8/rake.rb:566:in `call'
/usr/lib/ruby/site_ruby/1.8/rake.rb:574:in `sh'
/usr/lib/ruby/site_ruby/1.8/rake.rb:657:in `sh'
/usr/lib/ruby/site_ruby/1.8/rake.rb:652:in `sh'
/usr/lib/ruby/site_ruby/1.8/rake.rb:592:in `ruby'
/usr/lib/ruby/site_ruby/1.8/rake.rb:657:in `ruby'
/usr/lib/ruby/site_ruby/1.8/rake.rb:652:in `ruby'
/Users/yvon/Desktop/libxml-ruby-0.3.6/rakefile:40
/Users/yvon/Desktop/libxml-ruby-0.3.6/rakefile:39:in `chdir'
/Users/yvon/Desktop/libxml-ruby-0.3.6/rakefile:39
/Users/yvon/Desktop/libxml-ruby-0.3.6/rakefile:38:in `call'
/usr/lib/ruby/site_ruby/1.8/rake.rb:232:in `execute'
/usr/lib/ruby/site_ruby/1.8/rake.rb:232:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:232:in `execute'
/usr/lib/ruby/site_ruby/1.8/rake.rb:202:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:209:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `send'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:201:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:209:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `send'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:201:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:209:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `send'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:201:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:209:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `send'
/usr/lib/ruby/site_ruby/1.8/rake.rb:844:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:208:in `invoke_prerequisites'
/usr/lib/ruby/site_ruby/1.8/rake.rb:201:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/rake.rb:195:in `invoke'
/usr/lib/ruby/site_ruby/1.8/rake.rb:1719:in `run'
/usr/lib/ruby/site_ruby/1.8/rake.rb:1719:in `each'
/usr/lib/ruby/site_ruby/1.8/rake.rb:1719:in `run'
/usr/bin/rake:8
~/Desktop/libxml-ruby-0.3.6%>
B2561fdd05855be51aca982c54eb9f81?d=identicon&s=25 John N. Alegre (Guest)
on 2006-03-08 16:29
(Received via mailing list)
Daniel Harple wrote:

> The DP ruby applies several patches to ruby so you get a full working
> install. If you are having trouble installing ruby-libxml through
> rubygems, than download the tar.gz package, and run extconf with the
> --with-iconv-dir=/usr option, or you can wait until darwinports
> accepts my Portfile for libxml-ruby. Managing packages without the
> use of a package manager is a pain in the ass.

Both from a thread on the DP list and the experience of at least two
fellow
programmers, all those problems are due to trying to put DP Ruby /
RubyCocca on top of some installation of the same.  If you blow
away /opt/local and all of the installed RC frameworks, (you did do a
check
of all files installed when you installed RC didn't you?) then use DP
install ruby (which also creates a /opt/local tree with all the Ruby
libs
and then use DP to install RC, you are there.  The parts of RC that
depend
on Ruby libs will find those because the are under the same /opt/local
tree. No need to seach for ruby-libxml or any other dependent library.
RC
will know where to find them.

john
B2561fdd05855be51aca982c54eb9f81?d=identicon&s=25 John N. Alegre (Guest)
on 2006-03-08 19:55
(Received via mailing list)
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?

john
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-09 09:01
(Received via mailing list)
John N. Alegre <info@johnalegre.net> wrote:

> I wonder why it is a some do some dont?

the reason i didn't use dp at first time is because i had really bad
experiment with dp (not for ruby install).
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-09 13:25
(Received via mailing list)
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
B2561fdd05855be51aca982c54eb9f81?d=identicon&s=25 John N. Alegre (Guest)
on 2006-03-09 14:26
(Received via mailing list)
Daniel Harple wrote:

> They accepted the port. You may now install ruby-libxml with "port
> install rb-libxml2" (don't forget to sync, or selfupdate).
>
Did you tell them to include this in the dependencies for RubyCocoa?

john
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-09 17:40
(Received via mailing list)
John N. Alegre <info@johnalegre.net> wrote:

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

why ? this is not a rubycocoa dependency ?
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-09 17:40
(Received via mailing list)
Daniel Harple <dharple@generalconsumption.org> 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" ?
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-09 17:55
(Received via mailing list)
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
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-09 18:29
(Received via mailing list)
Daniel Harple <dharple@generalconsumption.org> 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
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-09 18:44
(Received via mailing list)
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
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-09 19:46
(Received via mailing list)
Daniel Harple <dharple@generalconsumption.org> 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 ?
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-09 21:30
(Received via mailing list)
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
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-10 08:25
(Received via mailing list)
Daniel Harple <dharple@generalconsumption.org> 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
This topic is locked and can not be replied to.