I am new to ruby and trying to make a simple desktop app using wxruby.
When I do: require ‘wx’ I get this error:
irb(main):001:0> require ‘wx’
LoadError:
dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle,
9): no suitable image found. Did find:
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle
from
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wx.rb:12:in require' from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wx.rb:12:in<top (required)>’
from (irb):1:in require' from (irb):1 from /usr/local/bin/irb:12:in’
I am new to ruby and trying to make a simple desktop app using wxruby.
Welcome.
When I do: require ‘wx’ I get this error:
Unfortunately, you can’t use wx interactively in irb. A gui app depends
on entering an ‘event loop’ where it waits for the user to do something.
This will just hang in irb.
What OS X version are you on? 1.9.3 is a very old version, the current
release is 2.0.1. You may be on Snow Leopard (10.6) in which case you’ll
need to look in the recent m.l. archives for a user-contributed gem -
unfortunately I haven’t got the trunk stable to build on this version
yet.
Regarding “require ‘wx’” in irb, I was just testing if I will be able to
use wx in my ruby code or not. I guess, ONLY “require ‘wx’” should give
me a ->true right?
So, after installing 2.0.1 and doing a “require ‘wx’”, i got this error:
irb(main):001:0> require ‘wx’
LoadError:
dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle,
9): Symbol not found: _ZN10wxCheckBox13MacControlHitEPvS0
Referenced from:
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle
Expected in: flat namespace
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle
from
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wx.rb:12:in require' from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wx.rb:12:in <top (required)>’
from (irb):1:in require' from (irb):1 from /usr/local/bin/irb:12:in ’
I get the same error if i do a “require ‘wx’” in a .rb file and try to
run it.
Thanks
Alex F. wrote:
Hi
On 07/07/2010 07:39, Utkarsh Sengar wrote:
I am new to ruby and trying to make a simple desktop app using wxruby.
Welcome.
When I do: require ‘wx’ I get this error:
Unfortunately, you can’t use wx interactively in irb. A gui app depends
on entering an ‘event loop’ where it waits for the user to do something.
This will just hang in irb.
What OS X version are you on? 1.9.3 is a very old version, the current
release is 2.0.1. You may be on Snow Leopard (10.6) in which case you’ll
need to look in the recent m.l. archives for a user-contributed gem -
unfortunately I haven’t got the trunk stable to build on this version
yet.
use wx in my ruby code or not. I guess, ONLY “require ‘wx’” should give
me a ->true right?
Yes. Although ultimately it would be nice to be able to test a GUI
design interactively.
So, after installing 2.0.1 and doing a “require ‘wx’”, i got this error:
irb(main):001:0> require ‘wx’
LoadError:
dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle,
9): Symbol not found: _ZN10wxCheckBox13MacControlHitEPvS0
Sorry, I can’t provide support for this gem - I didn’t build it.
You may be a bit stuck for getting wxRuby working with the system ruby
provided in 10.6. Apple has made things difficult by moving to 64-bit
architecture, since Carbon (that provides much of wxWidgets 2.8 GUI) is
32-bit only.
I’m using 10.6 and for wxRuby applications I’m using my own 32-bit build
of Ruby 1.9.1. This works just fine with the gems that are downloadable
from Rubyforge. Alternatively I can use the 2.0.1 build by using the
arch command - see following post.
use wx in my ruby code or not. I guess, ONLY “require ‘wx’” should give
me a ->true right?
Yes. Although ultimately it would be nice to be able to test a GUI
design interactively.
So, after installing 2.0.1 and doing a “require ‘wx’”, i got this error:
irb(main):001:0> require ‘wx’
LoadError:
dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle,
9): Symbol not found: _ZN10wxCheckBox13MacControlHitEPvS0
Sorry, I can’t provide support for this gem - I didn’t build it.
You may be a bit stuck for getting wxRuby working with the system ruby
provided in 10.6. Apple has made things difficult by moving to 64-bit
architecture, since Carbon (that provides much of wxWidgets 2.8 GUI) is
32-bit only.
I’m using 10.6 and for wxRuby applications I’m using my own 32-bit build
of Ruby 1.9.1. This works just fine with the gems that are downloadable
from Rubyforge. Alternatively I can use the 2.0.1 build by using the
arch command - see following post.
I am sorry for not detailing the error, when I ran this:
arch -i386 ruby -rubygems ruby-file.rb
I got this error “arch: posix_spawnp: ruby: Bad CPU type in executable”
So, did “uname -m” in my terminal and got i386. So, it seems I am in the
32bit kernel mode. That’s why “ruby --version” also returned
i386-darwin10.4.0.
So, to summarize:
I am running 32bit ruby 1.9.1 on Mac OS X 10.6 Snow Leopard
I manually installed wxruby (2.0.1 universal-darwin-9)
When I do “require ‘wx’” I get this error:
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in require': dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError) /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in <top (required)>’
from ruby-file.rb:1:in require' from ruby-file.rb:1:in ’
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle:
no matching architecture in universal wrapper -
Hmm - did you compile your Ruby 1.9 under OS X 10.6? This may be the
mismatch. My ruby 1.9 (which works with the gem) is a version I compiled
before upgrading. There may be some compile flags for Ruby 1.9 to force
arch and 10.5 compatibility. But I don’t know what they are.
Can you use Ruby 1.8? If so, the 10.6 system ruby in /usr/bin/ruby
should work with the 1.8 gem, using arch.
I am sorry for my never ending problems, I think i will shift to my
Ubuntu VM.
No problem - I blame Apple! Each platform has its own annoyances,
though.
/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wx.rb:12:in require': dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError) /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wx.rb:12:in <top (required)>’
from ruby-file.rb:1:in require' from ruby-file.rb:1:in ’
You shouldn’t need to mess around with ‘arch’ b/c both the executable
and gem are simple 32-bit (actually, the gem is dual intel/ppc)
I manually installed wxruby (2.0.1 universal-darwin-9)
Sounds like you may have installed the gem for Ruby 1.8 by mistake?
I am sorry for my never ending problems, I think i will shift to my
Ubuntu VM.
Thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.