tags:

views:

1260

answers:

2

I'll be taking a trip soon with my iPad, without my laptop. I'd like to continue to tinker with Ruby while I'm on the road. I have an iPhone developer program membership, and I'm not interested in submitting this stuff to the app store.

I found the shinycocos project, which appears to embed a Ruby interpreter in an app. But I can't get it to run, and it seems pretty customized for running cocos2d stuff.

My first goal is to run an interactive command line like Try Ruby!. After that, I'd like to enter small programs in a UITextView and run them. I'd appreciate any clues, tips, or existing projects you might know of.

+2  A: 

You'll probably be best off setting up a little server on your home machine to accept uploads of ruby code, run it on the server and return the results via the browser. I think there are some rails implementations out there that will do this for you.

TechZen
+1  A: 

The Rhodes Framework contains a working Ruby implementation for the iPhone. You could try just writing your own simple IRB clone with Rhodes and see how that goes. You won't be able to get it through the App Store, of course, but you don't care about that, anyway.

As a next step, you could steal their build recipes and compile your own.

In the future, it will probably be possible to use MacRuby, but for the time being, everybody who works on MacRuby either works for Apple or has signed an NDA, so they aren't saying anything. However, the MacRuby lead developer once said that MacRuby's ahead-of-time compiler could in the future be used to "run Ruby on resource-constrained small-size mobile internet devices" without ever mentioning the i-word.

[Note that this will probably not allow you to run an interpreter on the device, rather you would statically compile your code natively and then upload it to the device. And the compiler does not support eval, which is crucial for running something like IRB or even a full IDE on the device.]

At the moment, your best bet for a mobile Ruby IDE is probably Android.

Jörg W Mittag
thanks for the ideas. I'm working with Rhodes now.
slothbear