Can you develop your own iPhone apps in Ruby?

Hi, I'm developing an iPhone, and Objective-C is not my preferred language. As far as I can see, at the moment Ruby cannot be used to communicate with Cocoa Touch at the moment on the iPhone.

So my question is: am I wrong? Can I use Ruby on iPhone to develop Cocoa Touch applications. And what does the future for Ruby look like on the iPhone?

+48
ruby ios iphone cocoa-touch
Oct 20 '08 at 19:51
source share
17 answers

No, you're right. At present, and most likely in the foreseeable future, Ruby will not be an option, at least for AppStore applications. There is no reason you could not do this on a Jailbroken phone, but Apple has officially married Objective-C for official development.

+21
Oct 20 '08 at 19:54
source share

Now you can with RubyMotion

+74
May 04 '12 at 7:25
source share

On iPhone, mprotect () will fail if you try to use it to mark writable partitions of memory as executable. This destroys bridges, such as RubyCocoa (and probably MacRuby), which use libffi to create Objective-C method handlers at runtime. I believe that this is by design because it is not always the case.

Ultimately, it is more a platform policy than a technology, but there is a technical solution for this. Instead of generating custom method handlers at run time, precompile a pool of reconfigurable ones that are assigned as needed, essentially making the bridge process fully data-driven. As far as I know, this has not yet been done in RubyCocoa or MacRuby.

Another important thing to keep in mind is that the compiled Ruby and RubyCocoa runtimes can be significantly larger than the compiled Objective-C applications. If these libraries were available on the iPhone, that would not be a problem, but for now, even if you have RubyCocoa, you may not use it for the applications you distribute.

+48
Nov 09 '08 at 0:04
source share

You better be a programmer who knows several different languages ​​- think of Objective-C as a good learning opportunity.

I have found that what you learn in other languages ​​often makes you a better programmer in general and gives you a new perspective on other languages ​​that you already know.

+11
Oct 21 '08 at 9:06
source share

rhomobile is the ability to run ruby ​​code on an iPhone, but it is essentially web application development. The web server runs locally on the iPhone, and your ruby ​​code provides standard client-side web technologies (html / css / javascript).

http://rhomobile.com/

+8
Jan 24 '09 at 0:24
source share

In fact, the cocoa ruby ​​bridge is not entirely uncomfortable; everything works remarkably smoothly, up to connecting outputs to IB, etc. The resulting code looks beautiful.

Regarding iPhone development, if you want to use the official AppStore app, unfortunately, you are out of luck. Apple dictated that the iPhone is an Obj-C / Cocoa Touch, and there is a condition in the SDK that states that one of the things they reject for the application is the presence of the / JIT language interpreter, so you could not add a ruby interpreter in your application.

Disabling the theme, but fun, is why Flash for iPhone is Adobe's smoke. They could not get a swf player in the AppStore, even if they wanted, for an Apple license.

+7
Oct 20 '08 at 20:11
source share

Uh, Rhodes (Rhomobile) allows you to make your own applications on iPhone and all other smartphones. Yes, we use rendering through the WebUIView control. But we allow all device capabilities and synchronized local data.

+4
Sep 15 '09 at 19:14
source share

Maybe you should take a look at shinycocos . This is a subsidiary of cocos2d-iphone , an Objective-C game programming framework for the iPhone.

I have not played with it yet, but from git README I assume that it integrates Ruby 1.9.1 into your application.

+4
Nov 01 '09 at 3:35
source share

I installed the ruby ​​package from Cydia on my iPod Touch 1G, hacked at 3.1.3:

image

It seems to need work.

Now, as for cocoa -touch, this is a completely different story, which I would suggest.

+4
Jul 28 '10 at 7:10
source share

Take a look at http://www.appcelerator.com/products/titanium-mobile/ "Native web and iPhone apps for iPhone and Android."

Sounds good, doesn't it ?; -)

+2
Jan 07 '10 at
source share

No, you cannot create your own iOS application in Ruby. There are only two options for native apps for mac and iOS: -

C lens and Swift programming language

Tutorials: -

Apple's Official Objective-C Guide

Apple Official Swift Programming Guide

If you are familiar with Ruby and only want to create Ruby iOS apps. Ruby Motion may be a cross-platform option for you, but it's not free.

<strong> Cross-Platforms

+2
Jul 16 '15 at 14:11
source share

I guess this won't work right now, but I would suggest that in the end you can use MacRuby to create iphone apps. Apple does a lot of work.

Here is a link to an ADC article describing how to build normal cocoa applications

+1
Oct. 20 '08 at 21:19
source share

You do not need to use Objective-C to write applications for the iPhone. If you use QuickConnectiPhone, http://sourceforge.net/projects/quickconnect/ , you can write it all in JavaScript, CSS, and HTML and still have an installable application, not a web application.

If you know ruby, you are probably already working with JavaScript.

To learn how to install it, run it and other ideas will go to tetontech.wordpress.com

+1
Oct 24 '08 at 4:21
source share

There is an open Ruby- Cocoa bridge here , which you can try to get. But I understand that there is a little impedance mismatch between Ruby and ObjC, which makes it a little inconvenient to use.

0
Oct 20 '08 at 20:06
source share

Ruby Cocoa Bridge probably won't work. Most bridges for dynamic languages ​​need to create executable tricks (either manually or using libffi). More limited bridges (for more static languages) may not have such problems.

In any case, creating a bridge will probably require a more detailed look at the Objective-C runtime than just learning how to write Cocoa Touch applications, which are likely to hit in the first place.

0
Oct 28 '08 at 10:19
source share

This is currently not the case, Apple will change its policies, take a look at ShinyCocos, these are ruby ​​bindings for the Cocos2D-iphone gaming environment.

https://github.com/funkaster/shinycocos

0
Nov 09 2018-11-11T00:
source share

One possible solution would be to create an application, for example, a rice library (google it), which includes ruby-vm. I believe that you could create C ++ wrappers that you could open for ruby, thereby creating an environment for developing iphone with ruby. This probably needs a lot of work though ^^

-one
Nov 13 '09 at 17:25
source share



All Articles