Getting started with MacRuby and Xcode 4.2

I recently thought of getting started with MacRuby. I've installed Xcode 4.2 and i've installed MacRuby, but apparently i am missing something. In every tutorial i found so far it says, that i have to choose "MacRuby Application" from the Xcode templates ... but there is no such entry available. I've tried with 0.10 and with a nightly released a few days ago.

I've had a look at where MacRuby installs it's stuff and i found templates for Xcode 3.0 ... do i have to use these templates and how do i import them to Xcode 4.2?

Before i am getting started i would also like to know, if it's somehow safe to start with MacRuby? At first sight i thought 'yes', because of the new MacRuby book available -- but there seems to be not much activity on the MacRuby website (last blog entry from march, last year?) ... which can in my experience be a sign that you should better not rely on something. Does MacRuby have a future?


MacRuby templates used to reside in /Developer, but with the newest XCode they changed the file structure to provide everything within an .app bundle, this meant that they could install it directly through the Mac Appstore, rather than just installing an installer, that you would then have to run.

If you navigate into the /Applications/XCode.app folder, you will find Contents/Developer. This is the same folder that was in /Developer before. If you move the MacRuby files into the corresponding locations in /Applications/XCode.app/Contents/Developer... things should work. (You could even do sudo ln -s /Applications/XCode.app/Contents/Developer /Developer before you install MacRuby).


I stumbled onto this because I was getting a "macruby.h file not found" error.

I had to do two things with Xcode:
1- add this path to "framework search paths" in my project settings
/Library/Frameworks

2-Add a symbolic link to help Xcode find the MacRuby.framework
cd /Applications/Xcode.app/Contents/Developer/Library/Frameworks
sudo ln -s /Library/Frameworks/MacRuby.framework MacRuby.framework

链接地址: http://www.djcxy.com/p/10372.html

上一篇: 创建一个类似于UITableViewCell的可重用UIView

下一篇: 开始使用MacRuby和Xcode 4.2