RubyMotion和RestKit安装

时间:2013-05-06 23:55:38

标签: ios restkit rubymotion cocoapods

我正在尝试在RubyMotion项目中使用RestKit,事实证明它比预期困难得多。

我尝试过此处列出的方法https://github.com/rounders/RestKitTest

不幸的是,这会吐出错误,看起来像是

ERROR! Building vendor project `vendor/RestKit' failed to create at least one `.a' library.

我用来尝试安装RestKit的另一种方法是使用动态cocoapods,如下所述:http://thunderboltlabs.com/posts/restkit-object-mapping-with-rubymotion.html

以下Rakefile吐出以下错误

$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'bundler'
Bundler.require

require './lib/app_properties'
props = AppProperties.new

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.

  app.name = "TestApp"

  app.pods do
    pod 'RestKit/Network'
    pod 'RestKit/UI'
    pod 'RestKit/ObjectMapping'
    pod 'RestKit/ObjectMapping/JSON'
  end
end

错误:[!] Unable to find a specification for 'RestKit/Network'.

其他任何经历过这些问题的人都非常感谢

1 个答案:

答案 0 :(得分:2)

我今天刚刚与Restkit建立了一个项目。只要确保你有类似我的东西:

我的Rakefile使用Bundler

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require "rubygems"
require 'bundler'
Bundler.require

Motion::Project::App.setup do |app|
  app.name = 'AppName'
  app.pods do
    pod 'RestKit', '0.20.1'
  end
end

然后是我的Gemfile

source "https://rubygems.org"
gem "motion-cocoapods", "~> 1.3.0"
gem "cocoapods", "0.18.1"

然后

bundle
rake clean
rm -rf vendor
rake

应该有效: - )