Cannot get started

I’m sure I’ve done something basic wrong, but I don’t see it. I’m
running MAC OSX 10.6.4

I installed using ruby gems:
[Charles-Parkers-iMac:~] charlesparker% sudo gem install wxruby
Password:
Successfully installed wxruby-1.9.3-universal-darwin
1 gem installed
Installing ri documentation for wxruby-1.9.3-universal-darwin…
Installing RDoc documentation for wxruby-1.9.3-universal-darwin…

I created the initial test program which seemed to need the require
rubygems line:
require “rubygems”
require “wx”
include Wx

class MinimalApp < App
def on_init
Frame.new(nil, -1, “The Bare Minimum”).show()
end
end

MinimalApp.new.main_loop

And I tried to run it:
[Charles-Parkers-iMac:~/Code] charlesparker% ruby ./wxruby-test.rb
/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
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
require' from /Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wx.rb:12 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require’
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in
`require’
from ./wxruby-test.rb:2
[Charles-Parkers-iMac:~/Code] charlesparker%

Any help would be greatly appreciated!

Thanx - Charlie

When I search with Finder, I cannot find ANY files (other than my test
program) with wxruby or wx_ruby in the file name. Does this mean the gem
didn’t install the ruby bindings? The install appeared to work.

Thanx - Charlie

I found my problem; I had to use the 32 bit instead of the 64 bit
architecture, and the sample program works.

Out of curiosity, why do I need the “require rubygems” line before the
“require wx” line?

Thanx - Charlie

Charles P. wrote in post #956758:

I found my problem; I had to use the 32 bit instead of the 64 bit
architecture, and the sample program works.

Out of curiosity, why do I need the “require rubygems” line before the
“require wx” line?

Because you’ve used the “gem” command to install wxruby, it’s as simple
as that :slight_smile:

One thing to note though:

Successfully installed wxruby-1.9.3-universal-darwin
1 gem installed

This is an old version of wxRuby - it’s better if you grab the latest
from here:
http://rubyforge.org/frs/?group_id=35

( For OSX 10.6:
http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem)

For some reason this package isn’t available via gem command. Once you
download the file just run:

gem install wxruby-2.0.1-universal-darwin-9.gem

(make sure you uninstall the 1.9.3 wxruby first).

Hope that helps.

Łukasz