Hi Conrad, You are totally right--if I make 1.8.7 the default ruby version I can install and run rsruby gem without a hitch. Same install on 1.9.1 doesn't work. I investigated and as suspected the 1.8.7 gem install provides both the i386 binary and the x86_64 binary files while the 1.9.1 gem install only creates the x86_64 binary (see below). I'm still puzzled by what is influencing which type of file is generated--it doesn't seem to listen to the command line as sudo ARCHFLAGS="-arch i386" gem install rsruby -- --with-R-dir=$R_HOME wouldn't force the i386 binary to be produced. Don't you think this behavior is weird? Is it the placement within the file system that makes the OS decide whether this or that type of binary should be generated? And how do I force 1.9.1 gem install to do what 1.8.7 gem install does? Tim:~/.gem/ruby/1.8/gems/rsruby-0.5.1.1/lib> ls rsruby rsruby.rb rsruby_c.bundle Tim:~/.gem/ruby/1.8/gems/rsruby-0.5.1.1/lib> file rsruby_c.bundle rsruby_c.bundle: Mach-O universal binary with 2 architectures rsruby_c.bundle (for architecture i386): Mach-O bundle i386 rsruby_c.bundle (for architecture x86_64): Mach-O 64-bit bundle x86_64 Tim:~/.gem/ruby/1.8/gems/rsruby-0.5.1.1/lib> gem19 which rsruby (checking gem rsruby-0.5.1.1 for rsruby) /usr/local/lib/ruby19/gems/1.9.1/gems/rsruby-0.5.1.1/lib/rsruby.rb Tim:~/.gem/ruby/1.8/gems/rsruby-0.5.1.1/lib> cd /usr/local/lib/ruby19/gems/1.9.1/gems/rsruby-0.5.1.1/lib Tim:/usr/local/lib/ruby19/gems/1.9.1/gems/rsruby-0.5.1.1/lib> ls rsruby rsruby.rb rsruby_c.bundle Tim:/usr/local/lib/ruby19/gems/1.9.1/gems/rsruby-0.5.1.1/lib> file rsruby_c.bundle rsruby_c.bundle: Mach-O 64-bit bundle x86_64 On Mon, Dec 7, 2009 at 7:00 AM, <macruby-devel-request@lists.macosforge.org>wrote:
Send MacRuby-devel mailing list submissions to macruby-devel@lists.macosforge.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel or, via email, send a message with subject or body 'help' to macruby-devel-request@lists.macosforge.org
You can reach the person managing the list at macruby-devel-owner@lists.macosforge.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of MacRuby-devel digest..."
Today's Topics:
1. Re: mac & ruby question (Conrad Taylor) 2. Re: UTF8 Strings [resolved] (s.ross)
----------------------------------------------------------------------
Message: 1 Date: Sun, 6 Dec 2009 21:22:46 -0800 From: Conrad Taylor <conradwt@gmail.com> To: "MacRuby development discussions." <macruby-devel@lists.macosforge.org> Subject: Re: [MacRuby-devel] mac & ruby question Message-ID: <4697C26B-EC61-4CDE-9EC4-9040C7F5CF95@gmail.com> Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes"
TIm, does gems install correctly with Ruby 1.8.7 which is the default in Snow Leopard? This should be the case. Next, x86_64 is the default under Snow Leopard and your bundles are being correctly. Thus, I would recommend sticking with default compilation settings. For example, the following is all you need:
gem install hpricot
Thus, I would recommend going through the process again of reinstalling.
Good luck,
-Conrad
Sent from my iPhone
On Dec 6, 2009, at 8:43 PM, Tim Rand <timrandg@gmail.com> wrote:
I am sorry. This is not a macruby question per se, just a question about plain old ruby on mac (specifically snow leopard) question. But you guys for sure will know the answer, so I must ask. Why is it that after upgrading to snow leopard (10.6.2) a long list of gems no longer run on ruby 1.9.1?
Using Matt Aimonetti's sl_gems_update.rb file, I get: Please reinstall: eventmachine versions: 0.12.0, 0.12.0 fastthread versions: 1.0.1, 1.0.1 hpricot versions: 0.6.161, 0.6.161, 0.8.2, 0.8.2, 0.8.2, 0.8.2 hpricot-0.6.161/lib/universal versions: darwin9.0, darwin9.0 mongrel versions: 1.1.5, 1.1.5 rb-appscript versions: 0.5.1, 0.5.1 rmagick versions: 2.2.0, 2.2.0 rsruby versions: 0.4.5, 0.4.5 ruby-debug-base versions: 0.10.3, 0.10.3 sqlite3-ruby versions: 1.2.1, 1.2.1 tioga versions: 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8 tmail versions: 1.2.3.1, 1.2.3.1
Indeed, I had noticed already that hpricot, rsruby, and sqlite3 were no longer working. Reinstalling eventmachine and fastthread worked. But many of the others appear to install, but don't function:
Tim:~/Desktop/RubyClub> sudo env ARCHFLAGS="-arch i386" gem install why-hpricot --source http://gems.github.com Building native extensions. This could take a while... Successfully installed why-hpricot-0.7.229 1 gem installed Installing ri documentation for why-hpricot-0.7.229... Installing RDoc documentation for why-hpricot-0.7.229... Tim:~/Desktop/RubyClub> gem which hpricot (checking gem why-hpricot-0.7.229 for hpricot) /usr/local/lib/ruby19/gems/1.9.1/gems/why-hpricot-0.7.229/lib/ hpricot.rb Tim:~/Desktop/RubyClub> ruby -e 'require "hpricot"' /usr/local/lib/ruby19/gems/1.9.1/gems/why-hpricot-0.7.229/lib/ hpricot.rb:20:in `require': dlopen(/usr/local/lib/ruby19/gems/1.9.1/ gems/why-hpricot-0.7.229/lib/hpricot_scan.bundle, 9): no suitable image found. Did find: (LoadError) /usr/local/lib/ruby19/gems/1.9.1/gems/why-hpricot-0.7.229/lib/ hpricot_scan.bundle: mach-o, but wrong architecture - /usr/local/lib/ ruby19/gems/1.9.1/gems/why-hpricot-0.7.229/lib/hpricot_scan.bundle from /usr/local/lib/ruby19/gems/1.9.1/gems/why-hpricot-0.7.229/lib/ hpricot.rb:20:in `<top (required)>' from -e:1:in `require' from -e:1:in `<main>'
And file on that path gives: file /usr/local/lib/ruby19/gems/1.9.1/gems/why-hpricot-0.7.229/lib/ hpricot_scan.bundle Mach-O 64-bit bundle x86_64
I am pretty sure that the problem is with .bundle files being compiled for x86_64 architecture, but I explicitly told the os to use env ARCHFLAGS="-arch i386" and it ignored it and put the bundle files in the x86_64 architecture anyhow.
I am stuck. Why am I getting the mach-o but wrong architecture error?
It seems to be a problem with gems that have .bundle files. If anyone can explain how I should be installing gems in snow leopard so that they actually work, I would really like that person. Seriously. Tim _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel