RubyMotion错误:工具' xcodebuild'需要Xcode

时间:2014-05-07 13:57:51

标签: rubymotion

我使用:

创建了一个新的RubyMotion项目
motion create NewMotion

然后我安装了相关的包:

bundle install

现在每当我运行应用程序时,我都会收到错误:

➜  NewMotion  rake
/Users/info/.rvm/gems/ruby-2.0.0-p353/gems/bundler-1.6.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/Library/RubyMotion/lib/motion/project/xcode_config.rb:87:in `xcode_version'
/Library/RubyMotion/lib/motion/project/xcode_config.rb:99:in `validate'
/Library/RubyMotion/lib/motion/project/template/ios/config.rb:85:in `validate'
/Library/RubyMotion/lib/motion/project/config.rb:115:in `setup'
/Library/RubyMotion/lib/motion/project/app.rb:66:in `config'
/Library/RubyMotion/lib/motion/project/template/ios.rb:81:in `block in <top (required)>'
/Users/info/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/Users/info/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => default => simulator
(See full trace by running task with --trace)

请注意我使用Ruby ruby​​ 2.0.0p353

任何帮助都将受到高度赞赏。

干杯

1 个答案:

答案 0 :(得分:5)

好吧,好像我得到了解决这个问题的方法:

  • 从developer.apple.com
  • 安装Xcode
  • 将xcode-select指向Xcode开发人员目录

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer