chris-tulip
chris-tulip

Reputation: 1830

RubyMotion and RestKit Installation

I'm trying to use RestKit inside a RubyMotion project and it's proving to be much more difficult than expected.

I've tried the approach listed here https://github.com/rounders/RestKitTest

Unfortunately, this spits out and error that looks like

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

The other method I used to try and install RestKit was using motion-cocoapods as described here: http://thunderboltlabs.com/posts/restkit-object-mapping-with-rubymotion.html

the following Rakefile spits out the following error

$:.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

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

Anyone else who has gone through these issues help is greatly appreciated

Upvotes: 1

Views: 659

Answers (1)

Arkan
Arkan

Reputation: 6236

I've just set up a project with Restkit today. Just make sure you have something like me:

My Rakefile which uses 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

And then my Gemfile

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

Then

bundle
rake clean
rm -rf vendor
rake

It should work :-)

Upvotes: 2

Related Questions