Problem after installing wxruby, no suitable image found, on Mac OS 10.6 & 10.7 & Red-Hat
I am trying to install wxruby. I've tried gem install wxruby, gem install wxruby-19-2.0.0 download开发者_StackOverflow中文版ing the wxruby-2.0.1-universal-darwin-9.gem. I tried the arch -i386 ruby change and got an error on arch of unsupported architecture (on Snow Leopard and Lion).
I've tried it on Mac OS X Lion and Snow Leopard. Under ruby 1.8.7 and 1.9.2. And also tried on Linux (RED-HAT). All gave the same error. When I tried to compile it I got a swig version error which I fixed and then ton's of errors in the code of not finding size_t and other items. I tried a new install of wxwidgets (on Snow Leopard) and that did not help.
It always installs fine but when I run some test code I get:
/Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': dlopen(/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in <top (required)>'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in
require'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in
require'
from ./test_wxruby.rb:3:in `'
It does the same thing when I use irb require 'rubygems' require 'wx'
Please help. I really want to use this. My other cross-platform option is JRuby.
It's a known issue. Starting with Snow Laopard, OSX ships with 64-bit ruby set as default. And installed gem is 32-bit. In order to fix this, add following shebang to your ruby script (it will force script to be executed under 32-bit ruby):
#!/usr/bin/env arch -i386 ruby
require 'rubygems'
# This will work thanks to arch -i386
require 'wx'
精彩评论