简体   繁体   English

开始使用MacRuby和Xcode 4.2

[英]Getting started with MacRuby and Xcode 4.2

I recently thought of getting started with MacRuby. 我最近想过开始使用MacRuby。 I've installed Xcode 4.2 and i've installed MacRuby, but apparently i am missing something. 我已经安装了Xcode 4.2并安装了MacRuby,但显然我错过了一些东西。 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. 到目前为止我发现的每个教程都说,我必须从Xcode模板中选择“MacRuby Application”......但是没有这样的条目可用。 I've tried with 0.10 and with a nightly released a few days ago. 我已经尝试过0.10并且几天前每晚发布一次。

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? 我已经看过MacRuby安装它的东西,我找到了Xcode 3.0的模板......我是否必须使用这些模板,如何将它们导入Xcode 4.2?

Before i am getting started i would also like to know, if it's somehow safe to start with MacRuby? 在我开始之前,我还想知道,如果以某种方式从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. 乍一看,我认为'是',因为有新的MacRuby书可用 - 但MacRuby网站似乎没有太多活动(去年3月的最后一篇博文?)......根据我的经验可以这标志着你最好不要依赖某些东西。 Does MacRuby have a future? MacRuby有未来吗?

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. MacRuby模板曾经驻留在/ Developer中,但是使用最新的XCode,他们更改了文件结构以提供.app包中的所有内容,这意味着他们可以直接通过Mac Appstore安装它,而不仅仅是安装安装程序,然后必须运行。

If you navigate into the /Applications/XCode.app folder, you will find Contents/Developer. 如果您导航到/Applications/XCode.app文件夹,您将找到Contents / Developer。 This is the same folder that was in /Developer before. 这是/ Developer之前的文件夹。 If you move the MacRuby files into the corresponding locations in /Applications/XCode.app/Contents/Developer... things should work. 如果您将MacRuby文件移动到/Applications/XCode.app/Contents/Developer中的相应位置......事情应该可行。 (You could even do sudo ln -s /Applications/XCode.app/Contents/Developer /Developer before you install MacRuby). (在安装MacRuby之前,您甚至可以执行sudo ln -s /Applications/XCode.app/Contents/Developer / Developer)。

I stumbled onto this because I was getting a "macruby.h file not found" error. 我偶然发现了这个因为我收到了“找不到macruby.h文件”的错误。

I had to do two things with Xcode: 我不得不用Xcode做两件事:
1- add this path to "framework search paths" in my project settings 1-在我的项目设置中将此路径添加到“框架搜索路径”
/Library/Frameworks

2-Add a symbolic link to help Xcode find the MacRuby.framework 2 - 添加符号链接以帮助Xcode找到MacRuby.framework
cd /Applications/Xcode.app/Contents/Developer/Library/Frameworks
sudo ln -s /Library/Frameworks/MacRuby.framework MacRuby.framework

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM