Xcode and Ruby

Hi.

I am learning to program right now and I started with Objective-C. Although I am still working on it, I recently got word of a Language called Ruby. I wanted to try it out because it is a interpatid language no,t compiled.

The problem there is nothing like Xcode for it where you can write code run, test and distribute it.

I was hoping if I coul acssess Ruby from Xcode (it said on the Ruby website that c and c++ and some other languages could acssess it).

Also it is prity complicated to download (at least for me. I am not so used to using Terminal yet) so if you could give me some tips or give me a good link that would be nice too.


Thanks a lot.

Posted on Oct 1, 2012 3:32 PM

Reply
3 replies

Oct 1, 2012 4:09 PM in response to Neo2000

For Ruby development I recommend using Textwrangler or TextMate 2 instead of Xcode. Textwrangler has a shebang (#!) menu that allows you to run your Ruby program inside Textwrangler. TextMate 2 has a Ruby bundle, which you can use for running Ruby programs.


If you really want to use Xcode, create an external build system project. Set the build tool for the project to the Ruby interepreter, which should be in the following location:


/usr/bin/ruby


Mac OS X comes with Ruby installed. You shouldn't have to download and install it unless you need to use the latest version.

Nov 6, 2013 12:36 PM in response to Neo2000

Unless you want to use Cocoa with a custom user interface via the Interface Builder, there isn't a particular reason to use Xcode.


As mentioned, TextWrangler can be used with the version(s) of Ruby that are installed with the OS, and there is also RubyCocoa (which is also already installed).


For a compiled Ruby that is integrated into Xcode, the MacRuby project started at Apple, moved to open source, and has since been withering on the vine when most of the contributers moved over to RubyMotion, but it still works with OS X 10.6 Snow Leopard through OS X 10.8 Mountain Lion.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Xcode and Ruby

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.