开发者

Does Xcode 4 support ruby-on-rails?

Does Xcode 4 have support for rails projects? If so, to what extent?

UPDATE - Obviously it lets you edit text fi开发者_开发百科les. But does it give you any IDE features, e.g. syntax highlighting, navigation to declarations, code completion, etc... ?


In the past Xcode releases many were able to use the Xcode IDE for non-apple projects such as PHP, Rails, etc.

All you had to do was open Xcode organiser and drag your project in there and it worked. Not so with Xcode 4, but the feature has not been removed but in fact improved in my opinion.

In Xcode 4, click File > New > New Workspace.

Give it a name and once on the main editor window simply drag and drop your Rails, PHP, etc project onto the project navigator.

Then you can choose Editor > Syntax Coloring > [Any] for syntax highlighting.

M.


I paid up to intall XCode 4 thinking that it would be simpler to consolidate all my development to a single IDE. XCode is the default because of the built in Mac API docs. I built a few MacRuby (0.10) samples, which parse and run.

Problems are:

  1. XCode insists on using // to comment lines, which then don't parse.
  2. There is no debugging for Ruby files, only for the Objective C wrapper stub.
  3. There is no in-app "run" for rack, rails or scripting type apps.
  4. The syntax parsing is limited to keywords, strings, comments and characters.
  5. XCode doesn't understand .erb or .yaml files are html and ruby.

There were workarounds for 1 and 5 in 3.2 for 1 and 5 but they no longer work with 4 as far as I can see.

On the plus side, the documentation interface to OSX and NextStep is very nice and MacRuby and the UI editor work well together and allow bundling desktop apps which can be distributed standalone or via the app store. I would use it to build ruby apps that use the desktop GUI.

For conventional web or scripting apps you can 'bare edit' rails projects in the 'Workspace' area and then skip to the terminal to run a server or use script/console to debug; but for this NetBeans is still far superior IMHO with in-code debugging and automated tests and workflow.


As I'm unable to respond to the comments I'll just give answering your question a shot: Considering Apple's "what's new" page doesn't seem to list too many groundbreaking changes, I'm guessing Matt Ball's suggestion to go with the guide for Leopard and assuming nothing Rails or Ruby specific is new would be a safe and probably spot-on bet.


Giving a try to xcode 4 with rails. Work fine, except some color syntaxing trouble (with yml or haml file for example). It's great, expecialy the integration of git (to show easyly modified files)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜