# Ruby on the iPhone

**URL:** <https://www.ruby-forum.com/t/ruby-on-the-iphone/112488>\
**Category:** Ruby\
**Created:** [August 20, 2007, 4:10am UTC](https://www.ruby-forum.com/t/ruby-on-the-iphone/112488 "2007-08-20T04:10:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evan\_Light](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bc8723/32.png) [@Evan\_Light](https://www.ruby-forum.com/u/Evan_Light)\
**Post date:** [August 20, 2007, 4:10am UTC](https://www.ruby-forum.com/t/ruby-on-the-iphone/112488/1 "2007-08-20T04:10:30Z")

</div>

Anyone else out there realized that Ruby has been compiled for and now  
runs on the iPhone? If you have an iPhone, go visit this site:  
[http://iphone.nullriver.com/beta/](http://iphone.nullriver.com/beta/). Installer.app will help you  
easilly install a terminal and Ruby (!!!). Just go to /usr/local/bin  
and play. I did a tiny bit of benchmarking myself just for giggles.

[http://evan.tiggerpalace.com/?p=30](http://evan.tiggerpalace.com/?p=30)

Granted that I haven’t played with SWIG yet but I wonder how it would  
do for wrapping UIKit. I imagine that it’s not nearly as simple as it  
sounds.

Evan Light

---

<div class="post-metadata">

**Author:** ![Evan\_Light](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bc8723/32.png) [@Evan\_Light](https://www.ruby-forum.com/u/Evan_Light)\
**Post date:** [August 20, 2007, 4:25am UTC](https://www.ruby-forum.com/t/ruby-on-the-iphone/112488/2 "2007-08-20T04:25:31Z")

</div>

On Aug 19, 2007, at 19:09, Evan Light wrote:

> Anyone else out there realized that Ruby has been compiled for and now  
> runs on the iPhone? If you have an iPhone, go visit this site:  
> [http://iphone.nullriver.com/beta/](http://iphone.nullriver.com/beta/). Installer.app will help you  
> easilly install a terminal and Ruby (!!!). Just go to /usr/local/bin  
> and play. I did a tiny bit of benchmarking myself just for giggles.
> 
> [http://evan.tiggerpalace.com/?p=30](http://evan.tiggerpalace.com/?p=30)

Nearly this same message was posted two weeks ago.

> Granted that I haven’t played with SWIG yet but I wonder how it would  
> do for wrapping UIKit. I imagine that it’s not nearly as simple as it  
> sounds.

Wouldn’t RubyObjC be far more appropriate?

> **[rubyobjc.com](https://www.rubyobjc.com/)**
>
> Ruby Documentation Project. Documents, links, help, books for the Ruby programming language. Blogtari! powered web site.

---

<div class="post-metadata">

**Author:** ![Evan\_Light](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bc8723/32.png) [@Evan\_Light](https://www.ruby-forum.com/u/Evan_Light)\
**Post date:** [August 20, 2007, 4:25am UTC](https://www.ruby-forum.com/t/ruby-on-the-iphone/112488/3 "2007-08-20T04:25:31Z")

</div>

Unfortunately it doesn’t have most standard libraries or rubygems, which  
make it somewhat limited (e.g. irb doesn’t work). The iphone doesn’t  
have a  
compiler that runs ON the phone, so everything has to be cross-compiled  
on  
your own computer. That means even once ruby is running on the phone,  
you  
would have to pre-compile any gems with C before putting them on the  
phone.  
For more complicated libraries such as ruby, compiling it required a lot  
of  
hand-tweaking and static compiling. If anyone wants to lend a hand,  
especially with just getting a solid ruby binary with stdlib and  
rubygems,  
it would be greatly appreciated. There is a working toolchain that you  
can  
install on your computer. We use this to compile anything (cocoa apps,  
or  
just binaries we run from the shell). You can check out the following  
sites  
for more detail:

[http://iphone.natetrue.com](http://iphone.natetrue.com)  
[http://iphone.fiveforty.net/wiki/index.php?title=Main\_Page](http://iphone.fiveforty.net/wiki/index.php?title=Main_Page)

Check out the IRC channels from the 2nd link. Most of the active  
discussion,  
especially for compiling, is in #iphone-dev and #iphone-uikit. The  
current  
ruby binary was compiled by NerveGas.

If you have not been actively following the iphone hackery, there is a  
lot  
of interesting and impressive work that’s been done.

Matt

PS - Python is working pretty well, and includes a working module for  
sqlite. There is a sqlite3 binary in the first link, if you want to run  
that  
directly from the shell.

---

<div class="post-metadata">

**Author:** ![Evan\_Light](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bc8723/32.png) [@Evan\_Light](https://www.ruby-forum.com/u/Evan_Light)\
**Post date:** [August 20, 2007, 12:27pm UTC](https://www.ruby-forum.com/t/ruby-on-the-iphone/112488/4 "2007-08-20T12:27:22Z")

</div>

On Aug 19, 10:24 pm, Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Nearly this same message was posted two weeks ago.  
> Sorry for the repost then.

> > Granted that I haven’t played with SWIG yet but I wonder how it would  
> > do for wrapping UIKit. I imagine that it’s not nearly as simple as it  
> > sounds.
> 
> Wouldn’t RubyObjC be far more appropriate?
> 
> [http://www.rubyobjc.com/](http://www.rubyobjc.com/)

True. SWIG doesn’t accomodate Objective-C, does it? 😉 Bitten by my  
over-enthusiasm.
