# OS X Snow Leopard + wxRuby 2.0.1 gem - WORKING

**URL:** <https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192>\
**Category:** wxRuby\
**Created:** [July 7, 2010, 11:40am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192 "2010-07-07T11:40:44Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [July 7, 2010, 11:40am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/1 "2010-07-07T11:40:44Z")

</div>

Hi

It is possible to use the standard wxRuby 2.0.1 gem with the standard  
system ruby in /usr/bin/ruby in OS X 10.6

1. download the gem

[http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem](http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem)

1. install it from the downloaded file

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

1. run ruby like this, forcing 32-bit mode

arch -i386 ruby -rubygems \<scriptfile.rb\>

Have tested with a couple of samples and this works fine. Appreciate any  
feedback. Of course, we are still aiming to get full compatibility, but  
for various reasons this is quite difficult.

Thanks to some advice on this page (comment #4)

> **[Upgrading to Snow Leopard](https://rubyonrails.org/2009/8/30/upgrading-to-snow-leopard)**
>
> Last Friday, Apple released their new OS version: Snow Leopard. Upgrading to SL is very easy and even gives you back quite a lot of HD space.However a few things have changed in the OS and you need to understand what is going on so you won’t get...

alex

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [July 8, 2010, 12:00am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/2 "2010-07-08T00:00:07Z")

</div>

Thanks Alex.

Tested it with my app on Snow Leopard, it started OK until “require  
‘nokogiri’”

Here is output:

/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle:  
dlopen(/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle,  
9): no suitable image found. Did find: (LoadError)  
/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle:  
mach-o, but wrong architecture -  
/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle

I guess that’s because Nokogiri is built with 64-bit.

Zhimin

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [July 8, 2010, 1:27am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/3 "2010-07-08T01:27:30Z")

</div>

That would be correct, you would need a 32 bit copy of nokogiri, in  
order  
for it to work properly.

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [September 13, 2010, 2:13pm UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/4 "2010-09-13T14:13:59Z")

</div>

Sweet. Runs perfectly on my 10.6.4 machine.

Did anyone manage to launch the 32bit ruby environment from Netbeans?

Thanks,  
Tony

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [July 8, 2010, 2:40pm UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/5 "2010-07-08T14:40:51Z")

</div>

Alex & Mario,

Yes, My app now works on Snow Leopard (after using 32-bit nokogiri),  
Thanks!

Regards,  
Zhimin

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [December 22, 2010, 7:28am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/6 "2010-12-22T07:28:08Z")

</div>

Some good news…

Alex, your method didn’t work for me immediately but I found a method  
that works for me and may help others.

I have a MacBook Pro (64-bit) running OS X 10.6.  
Like others, I wanted to run Ruby 1.9.2 (latest) and wxRuby 2.0.1  
(latest).

I use RVM to install Ruby 1.9.2 (and manage my ruby versions).  
(See [Installing Ruby and Rails on Mac OS X](http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac))

By default, RVM builds the Ruby 64-bit version (only).  
I finally found a post that indicates how to build both 32-bit and  
64-bit versions of Ruby.

Briefly, here’s how users can get both built:  
rvm install ruby-1.9.2-head -C --with-arch=x86\_64,i386

Here’s how to check what you have:  
file `which ruby` | perl -pe ‘s|^.\*/||’

(Which will produce output like this:)  
ruby: Mach-O universal binary with 2 architectures  
ruby (for architecture x86\_64): Mach-O 64-bit executable x86\_64  
ruby (for architecture i386): Mach-O executable i386

Visit:  
[http://rubyforge.org/frs/?group\_id=35](http://rubyforge.org/frs/?group_id=35)

And, download this gem:  
wxruby-ruby19-2.0.1-x86-darwin-9.gem

Now, install the gem (no sudo required):  
(Note, you may want to cd to your Downloads folder.)  
gem install wxruby-ruby19-2.0.1-x86-darwin-9  
Successfully installed wxruby-ruby19-2.0.1-x86-darwin-9

## Create a wxruby test script (wxtest.rb):

#!/usr/bin/env arch -i386 ruby

require ‘wx’  
include Wx

## App.run do frame = Frame.new(nil, :title =\> ‘So far, so good…’) frame.show end

And run it:

> ruby wxtest.rb

Ok, so this particular working set produced a window.  
So, we (or I anyway) have a way to proceed.

Alex - I hope this somehow helps you find out what the problem  
(32-bit vs 64-bit) might be. Any thoughts?

Cheers,  
Ridge

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [November 28, 2012, 8:13am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/7 "2012-11-28T08:13:40Z")

</div>

bad news  
the output is:  
/Users/rubyzen/rubymineprojects/wxruby/first\_window.rb  
arch: posix\_spawnp: ruby: Bad CPU type in executable

kouheimatoMacBook-Air:wxruby rubyzen$ arch -i386 ruby -rubygems  
/Users/rubyzen/rubymineprojects/wxruby/first\_window.rb  
arch: posix\_spawnp: ruby: Bad CPU type in executable

xiong-kouheimatoMacBook-Air:wxruby rubyzen$ arch  
i386

xiong-kouheimatoMacBook-Air:wxruby rubyzen$ ruby -v  
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86\_64-darwin10.8.0]  
xiong-kouheimatoMacBook-Air:wxruby rubyzen$ which ruby  
/Users/rubyzen/.rvm/rubies/ruby-1.9.2-p320/bin/ruby  
xiong-kouheimatoMacBook-Air:wxruby rubyzen$ gem q -d -n wxruby  
/Users/rubyzen/.rvm/rubies/ruby-1.9.2-p320/bin/gem:4: warning: Insecure  
world writable dir /usr in PATH, mode 040777

\*\*\* LOCAL GEMS \*\*\*

wxruby (2.0.1)  
Platform: universal-darwin-9  
Author: wxRuby development team  
Rubyforge: [http://rubyforge.org/projects/wxruby](http://rubyforge.org/projects/wxruby)  
Homepage: [http://wxruby.org/](http://wxruby.org/)  
Installed at: /Users/rubyzen/.rvm/gems/ruby-1.9.2-p320

```
Ruby interface to the wxWidgets GUI library

```

xiong-kouheimatoMacBook-Air:wxruby rubyzen$ file  
/Users/rubyzen/.rvm/rubies/ruby-1.9.2-p320/bin/ruby  
/Users/rubyzen/.rvm/rubies/ruby-1.9.2-p320/bin/ruby: Mach-O 64-bit  
executable x86\_64

xiong-kouheimatoMacBook-Air:lib rubyzen$ file wxruby2.bundle  
wxruby2.bundle: Mach-O universal binary with 2 architectures  
wxruby2.bundle (for architecture ppc): Mach-O bundle ppc  
wxruby2.bundle (for architecture i386): Mach-O bundle i386

Alex F. wrote in post #923756:

> Hi
> 
> It is possible to use the standard wxRuby 2.0.1 gem with the standard  
> system ruby in /usr/bin/ruby in OS X 10.6
> 
> 1. download the gem
> 
> [http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem](http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem)
> 
> 1. install it from the downloaded file
> 
> sudo gem install wxruby-2.0.1-universal-darwin-9.gem
> 
> 1. run ruby like this, forcing 32-bit mode
> 
> arch -i386 ruby -rubygems \<scriptfile.rb\>
> 
> Have tested with a couple of samples and this works fine. Appreciate any  
> feedback. Of course, we are still aiming to get full compatibility, but  
> for various reasons this is quite difficult.
> 
> Thanks to some advice on this page (comment #4)  
> [http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard](http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard)
> 
> alex

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [December 22, 2010, 1:40pm UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/8 "2010-12-22T13:40:02Z")

</div>

Hi Ridge

On 22/12/2010 06:28, Ridge McGhee wrote:

> I have a MacBook Pro (64-bit) running OS X 10.6.  
> Like others, I wanted to run Ruby 1.9.2 (latest) and wxRuby 2.0.1  
> (latest).  
> That sounds similar to my setup.

> I use RVM to install Ruby 1.9.2 (and manage my ruby versions).  
> (See [Installing Ruby and Rails on Mac OS X](http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac))
> 
> By default, RVM builds the Ruby 64-bit version (only).  
> I finally found a post that indicates how to build both 32-bit and  
> 64-bit versions of Ruby.

I hadn’t come across RVM - this looks great.

> Ok, so this particular working set produced a window.  
> So, we (or I anyway) have a way to proceed.
> 
> Alex - I hope this somehow helps you find out what the problem  
> (32-bit vs 64-bit) might be. Any thoughts?

I’m just headed off for xmas so won’t have a go at this til new year -  
but it sounds very promising as a way to restart development on the  
stable branch with 10.6. What I’ll need to test is that I can use this  
ruby to compile against wxWidgets 2.8 - which is what has been the  
headache so far.

best wishes  
alex

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [August 7, 2013, 5:22am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/9 "2013-08-07T05:22:12Z")

</div>

Alex F. wrote in post #923756:

> Hi
> 
> It is possible to use the standard wxRuby 2.0.1 gem with the standard  
> system ruby in /usr/bin/ruby in OS X 10.6
> 
> 1. download the gem
> 
> [http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem](http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem)
> 
> 1. install it from the downloaded file
> 
> sudo gem install wxruby-2.0.1-universal-darwin-9.gem
> 
> 1. run ruby like this, forcing 32-bit mode
> 
> arch -i386 ruby -rubygems \<scriptfile.rb\>
> 
> Have tested with a couple of samples and this works fine. Appreciate any  
> feedback. Of course, we are still aiming to get full compatibility, but  
> for various reasons this is quite difficult.
> 
> Thanks to some advice on this page (comment #4)  
> [http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard](http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard)
> 
> alex

Hello,

I tried this and for me, that’s not works.

I install ruby-1.9.3-p448 with rvm  
and then, install wxruby-2.0.1-darwin from gem source  
and then, call ruby on i386 (wich is my arch) for my hello.rb file (who  
use wx code)

but this said my that it is the bad cpu…

do you have an idea ?

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [August 7, 2013, 10:22am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/10 "2013-08-07T10:22:06Z")

</div>

install ruby 1.9

rvm install 1.9.3 -C --with-arch=i386

switch to ruby 1.9.3 (rvm use…)

install this version:  
[http://rubyforge.org/frs/download.php/63385/wxruby-ruby19-2.0.1-x86-darwin-9.gem](http://rubyforge.org/frs/download.php/63385/wxruby-ruby19-2.0.1-x86-darwin-9.gem)

and run your script:

ruby \<yourscript.rb\>

it works for me.

Cheers,

fabio.

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [August 7, 2013, 2:06pm UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/11 "2013-08-07T14:06:40Z")

</div>

Fabio P. wrote in post #1117980:

> install ruby 1.9
> 
> rvm install 1.9.3 -C --with-arch=i386
> 
> switch to ruby 1.9.3 (rvm use…)
> 
> install this version:  
> [http://rubyforge.org/frs/download.php/63385/wxruby-ruby19-2.0.1-x86-darwin-9.gem](http://rubyforge.org/frs/download.php/63385/wxruby-ruby19-2.0.1-x86-darwin-9.gem)
> 
> and run your script:
> 
> ruby \<yourscript.rb\>
> 
> it works for me.
> 
> Cheers,
> 
> fabio.

Thanks Fabio, now the server seems to works great and i can have my  
ruby-1.9.3-p448 universal (because, the ruby package from githurb is  
not… i give him, and try this before for change the arch compilation  
for install , but it is not the same package… github on the site talk  
about no have implementation down to osx-10.7 for his GUI software and  
said that it is because fo some tools that is not in osx-10.6.8 … so  
maybe that is why also they don’t have the complete ruby package  
universal… i’m really sorry with this segregation from [github.com](http://github.com)  
…) and that’s works great for me also.

But… do you have the same warning about libyaml ?  
I try to install this from rvm (rvm install yaml… rvm install libyaml,  
etc…) without any success. (it is really difficult to have something  
good on osx-10.6.8… but i don’t want to change for osx-10.7… and i  
don’t like the new politic and practice of apple for lot of thinks…

if you find solution for libyaml warning, i give it so…  
if i find before, i take it so.

thanks Fabio

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [August 8, 2013, 1:48am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/12 "2013-08-08T01:48:10Z")

</div>

ok, hello again, i find it:

0 with the jewerlybox i update rvm to the nex last version (can do by  
terminal)  
1 remove all ruby-1.9.3 sources from Users/“HOME”/.rvm/src and  
/Users/“HOME”/.rvm/archive  
2 rvm get head  
3 rvm reload  
4 rvm install 1.9.3 -C --with-arch=i386 (again)  
5 rvm use 1.9.3

that’s works for me, no more libyaml warnings (so, irb can be use to).

thanks to everybody for read and help, and have a good day.

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [August 7, 2013, 3:07pm UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/13 "2013-08-07T15:07:24Z")

</div>

ok, i find this:

> <https://stackoverflow.com/questions/10724983/libyaml-missing-after-installing-rvm-ruby-1-9-3-p125-32-bit-on-osx-lion>

they talk about doing an i386 install of libyaml with this code:

CONFIGURE\_OPTS=“–with-arch=i386” CFLAGS=“-arch i386” LDFLAGS=“-arch  
i386” rvm pkg install libyaml

and so, reinstall the ruby (same code, but reinstall in place of install  
not works for me: error -j2) with exactly same procedure from rvm  
install -C again…

I just do it, and so…

not works, error -j2.

i will see again tomorrow.

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [August 31, 2013, 3:17am UTC](https://www.ruby-forum.com/t/os-x-snow-leopard-wxruby-2-0-1-gem-working/191192/14 "2013-08-31T03:17:35Z")

</div>

also, i find something maybe i,nterest you about osx-10.6.X  
you can change your arch from boot (push buttons “6” and “4” in the same  
time) for x86\_64.  
And then, try it and if of, you can also change definitively for this  
arch (go for a look on apple site about “change arch from 32 to 64  
bits”), it is really simple (don’t follow other link where all is more  
complicate for nothing more).

after that, install will be more easy for all dependencies.

(so… if you have some virtual machines, maybe take care about  
necessity to reinstall them again…)
