1

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

我已经尝试过这里列出的方法https://github.com/rounders/RestKitTest

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

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

我用来尝试安装 RestKit 的另一种方法是使用 motion-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'.

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

4

1 回答 1

2

我今天刚刚用 Restkit 建立了一个项目。只要确保你有像我这样的东西:

我使用 Bundler 的 Rakefile

# -*- 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

它应该工作:-)

于 2013-05-22T10:16:14.443 回答