wxRuby on Snow Leopard 10.6

I upgraded from Leopard to Snow Leopard and noticed my wxRuby project
would no longer run. I put more information here, but was told my post
“seems” to contain spam. More information if requested.

/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle,
9): no suitable image found. Did find: (LoadError)
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle

I’ve seen a fix on some blog posts about calling:

sudo env ARCHFLAGS="-arch x86_64"

before doing a gem install, but this doesn’t seem to help.

Any insight would be greatly appreciated.

Thanks!
Mike

First of all, it looks like the version your trying to run, is wxRuby
1.9.3,
which is way out dated, have you tried updating to the latest version,
2.0.1?

Second, are you running on a 64 bit processor? That’s the only reason
why
you would need to define the -arch x86_64 bit flag, as that is the
designation for 64 bit processors. If your on a 32 bit processor, then
this
should not be needed at all.

And finally, be sure, that if you do update to 2.0.1, that Mac Ports has
a
suitable wxMac version of 2.8.10, which it should, since the gem is
compiled
against that. So you may need to update to 2.8.10 of wxMac if it’s not
installed at that version.

If these things don’t help, please feel free to let us know, we prefer
to
use the latest version of wxRuby, as more features, and more bugs have
been
fixed in these versions, then in the older version, especially from the
1.9.x series of the core library. It was very experimental builds of
the
core library, with many changes. Also make sure you are running on Ruby
itself at version 1.8.7, or 1.9.2 (Pre-Alpha I believe), as these are
the
latest Ruby runtime libraries we link to as well. It’s basically a
similar
situation to the wxMac above.

HTH,

Mario

Mario S. wrote:

First of all, it looks like the version your trying to run, is wxRuby
1.9.3,
which is way out dated, have you tried updating to the latest version,
2.0.1?

When I do a ‘gem install wxruby’ that’s the version that comes down. I
did a self-update to rubygems, so I’m at 1.3.5 (from the base Snow
Leopard comes with 1.3.1)

Second, are you running on a 64 bit processor? That’s the only reason
why
you would need to define the -arch x86_64 bit flag, as that is the
designation for 64 bit processors. If your on a 32 bit processor, then
this
should not be needed at all.

I’m using a MacBook Pro with the Core 2 Duo with Snow Leopard. From
what I’ve read, 10.5 and up is 64-bit based and this is a 64-bit
processor.

And finally, be sure, that if you do update to 2.0.1, that Mac Ports has
a
suitable wxMac version of 2.8.10, which it should, since the gem is
compiled
against that. So you may need to update to 2.8.10 of wxMac if it’s not
installed at that version.

This may be the source of my problem. I do not have wxMac installed (at
least as far as I know). I pulled it down, but I’m getting compile
errors on

libwxtiff-2.8.a, file is not of required architecture
libwxpng-2.8.a, file is not of required architecture

So, another problem to look at.

If these things don’t help, please feel free to let us know, we prefer
to
use the latest version of wxRuby, as more features, and more bugs have
been
fixed in these versions, then in the older version, especially from the
1.9.x series of the core library. It was very experimental builds of
the
core library, with many changes. Also make sure you are running on Ruby
itself at version 1.8.7, or 1.9.2 (Pre-Alpha I believe), as these are
the
latest Ruby runtime libraries we link to as well. It’s basically a
similar
situation to the wxMac above.

It looks likes the version of ruby packaged with Snow Leopard is

ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]

I’ll keep working on getting wxMac installed, but if there’s anything
wrong with my setup or approach so far, any pointers would be great.

Thanks!
Mik

Also, after installing the 2.0.1 gem (through rubygems), I receive the
same error:

/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle,
9): no suitable image found. Did find: (LoadError)
/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require' from /Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require

Michael D. wrote:

I upgraded from Leopard to Snow Leopard and noticed my wxRuby project
would no longer run. I put more information here, but was told my post
“seems” to contain spam. More information if requested.

/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle,
9): no suitable image found. Did find: (LoadError)
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle

As you’ve probably realised, the binary gem for Ruby 1.8 and Ruby 1.9 on
OS Xis built on 10.5 with 10.4 compatibility forced. With the change of
architectures between 10.5 and 10.6 the links to 32-bit libraries like
libtiff (where we use the OS X system versions) aren’t valid any more.

I’ll be upgrading to 10.6 myself soon so the next releases should fix
this compatibility. Until then you could probably just compile your own
from source - if you have the Developers’ Tools installed for OS X,
you’ll already have g++, swig (check the version though) and wxWidgets,
so it shouldn’t need anything more than unpacking the tarball and

rake
[optional:] strip -x lib/wxruby2.bundle
rake gem WXRUBY_VERSION=2.0.1
sudo gem install wxruby…

cheers
alex

Throwing these two messages together:

On Sun, Sep 20, 2009 at 10:04 PM, Michael D. [email protected]
wrote:

When I do a ‘gem install wxruby’ that’s the version that comes down. I
did a self-update to rubygems, so I’m at 1.3.5 (from the base Snow
Leopard comes with 1.3.1)

You already tried what I was going to suggest next, which is in your
next
email, but the solution I probably figured out.

I’m using a MacBook Pro with the Core 2 Duo with Snow Leopard. From
what I’ve read, 10.5 and up is 64-bit based and this is a 64-bit
processor.

Ok, I’m just making sure that you are on a x86-64 bit processor. This
will
lead into another part below.

This may be the source of my problem. I do not have wxMac installed (at
least as far as I know). I pulled it down, but I’m getting compile
errors on

libwxtiff-2.8.a, file is not of required architecture
libwxpng-2.8.a, file is not of required architecture

So, another problem to look at.

This is probably cause it is looking for libpng, libtiff, instead of
using
their built-in replacements, I’ll explain this below.

It looks likes the version of ruby packaged with Snow Leopard is

ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]

I’ll keep working on getting wxMac installed, but if there’s anything
wrong with my setup or approach so far, any pointers would be great.

And here is where we get to all of the problems, and didn’t realize it
till
now. Your running on version 10.0 of Darwin. All of the gems are
currently
built for version 9.0 of Darwin. There being part of the problem. But
the
specific problem that you are getting, is from the fact that it can’t
find
the wxMac Dynlib’s in order to access the wxWidgets functionality.
Cause of
this, wxRuby can’t operate. So we’ll go back up, to the point of
needing to
compile wxWidgets and wxRuby in order to get yourself a Installation of
wxRuby going.

First off, you need to follow the instructions provided here:
http://wxruby.rubyforge.org/wiki/wiki.pl?InstallingFromSource

This will allow you to build wxRuby, and wxWidgets. It is detailed for
all
the things you need in order to build wxRuby, and as well as
instructions on
how to build wxWidgets. I would strongly suggest that you follow these
instructions, and make sure you are using Swig 1.3.38, as I believe
that’s
the version we are currently requiring to build wxRuby.

If you are in need of help with these instructions, please feel free to
drop
by the wxRuby chat room, as I am sitting there now. It is located on
irc://
irc.freenode.net/#wxruby And if you are able to get a build of wxRuby
for
Darwin 10, may I please suggest that you offer it back to us, so that we
can
add it to the release, so we have covered another platform?

Thanks,

Any update to getting this to work. I have the same problem. In snow
leopard, I tried this:

$ sudo gem install wxruby

and I get this

/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle,
9): no suitable image found. Did find: (LoadError)
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle

which among others makes me curious why v. 1.9.3 is the default
installed even though it is an outdated version.

Me and Mike, and another person have been working on this, and I will be
sending an email to the Developer’s list in a moment in regards to our
failure with that, as well as some patches for the OS X 10.6 stuff.

L8ers,

Mario

Nathan E. wrote:

Any update to getting this to work. I have the same problem. In snow
leopard, I tried this:

$ sudo gem install wxruby

and I get this

/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle,
9): no suitable image found. Did find: (LoadError)
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle

which among others makes me curious why v. 1.9.3 is the default
installed even though it is an outdated version.

I haven’t had any success. After trying to compile the dependencies
needed to compile the wxRuby source (and failing at many points) I
eventually gave up. I’m hoping that someone with a bit more Mac
experience may come along and help out, but until then I fear we’re out
of luck.

Mike

Michael D. wrote:

I haven’t had any success. After trying to compile the dependencies
needed to compile the wxRuby source (and failing at many points) I
eventually gave up.

If you have the Mac Developer Tools installed, I don’t think there
should be any dependencies - wxWidgets, Ruby and SWIG should already be
installed. Unless, possibly the version of SWIG isn’t compatible.

I’m hoping that someone with a bit more Mac
experience may come along and help out, but until then I fear we’re out
of luck.

I’m going to upgrade to 10.6 in the near future so will be looking at
this shortly.

alex

Nathan E. wrote:

/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle

which among others makes me curious why v. 1.9.3 is the default
installed even though it is an outdated version.

I don’t know why Rubygems does this sometimes, but the remote install
fails to find the correct version. If this happens download the latest
gem version from file download page on Rubyforge and call sudo gem
install wxruby in the same directory as the downloaded file, or instead
of ‘wxruby’ give the file path.

But this probably won’t work because we have only built on 32-bit arch
for OS X, using 10.5

alex

Thanks for the update guys. Yea, I actually did end up manually
downloading the latest version from the rubyforge site and trying to
install it that way with the result being the same error but for the new
version.

LoadError:
dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle,
9): no suitable image found. Did find:
/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle

There should be a way around this, at the very least as an alternative,
consider pushing the gem to gemcutter.org which is as simple as gem
publishing can get and it almost certainly won’t have this version
problem. Then the gem can be installed with

$ gem install wxruby --source http://gemcutter.org

Alex F. wrote:

I don’t know why Rubygems does this sometimes, but the remote install
fails to find the correct version.

Judging by the listing at http://gemcutter.org, the platform string for
v1.9.3 does not specify a darwin version, it is only
“universal-darwin”[1]. Subsequent gems specify “universal-darwin-9”.
Since Snow Leopard’s platform string is “universal-darwin-10”[2] v1.9.3
matches Snow Leopard[3] and it will be selected for installation.

I just ran in to this problem with the wxruby gem too. I’m fairly new to
ruby and gems, so I did the research above to try to understand what was
going on. Hopefully it is not too obvious and can help someone.

I’m hoping for a gem for darwin-10 soon too.

Cheers,
Dave Cameron

[1] RubyGems.org | your community gem host
[2] you can check this by running gem environment
[3] matching is explained in gem help platforms