Cocoapods: TypeError - Unable to convert Ruby value `"AFNetworking"' into a CFTypeRef.

Created on 25 Apr 2016  路  5Comments  路  Source: CocoaPods/CocoaPods

https://github.com/CocoaPods/CocoaPods/issues/4520

Command

/Users/rob/.rvm/gems/ruby-2.2.0/bin/pod install

Report

  • What did you do?
    Updated to 1.0.x and tried to do pod install
  • What did you expect to happen?
    Pods to install with great success
  • What happened instead?
    Ruby type conversion error

    Stack

   CocoaPods : 1.0.0.beta.8
        Ruby : ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
    RubyGems : 2.4.6
        Host : Mac OS X 10.11.4 (15E65)
       Xcode : 7.3 (7D175)
         Git : git version 2.6.4 (Apple Git-63)
Ruby lib dir : /Users/rob/.rvm/rubies/ruby-2.2.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 459f7e038abb2569618f96428134175cb18b3ff9

Plugins

cocoapods-deintegrate : 1.0.0.beta.1
cocoapods-plugins     : 1.0.0.beta.1
cocoapods-search      : 1.0.0.beta.2
cocoapods-stats       : 1.0.0.beta.4
cocoapods-trunk       : 1.0.0.beta.4
cocoapods-try         : 1.0.0.beta.4
slather               : 2.1.0

Podfile

platform :ios, '8.0'
target 'MyApp'

inhibit_all_warnings!
use_frameworks!

# Networking 
pod 'AFNetworking', '~> 2.5.1'

Error

TypeError - Unable to convert Ruby value `"AFNetworking"' into a CFTypeRef.
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:383:in `RubyValueToCFTypeRef'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:402:in `block in RubyHashToCFDictionary'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:400:in `each'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:400:in `RubyHashToCFDictionary'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:372:in `RubyValueToCFTypeRef'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:402:in `block in RubyHashToCFDictionary'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:400:in `each'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:400:in `RubyHashToCFDictionary'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:372:in `RubyValueToCFTypeRef'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:402:in `block in RubyHashToCFDictionary'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:400:in `each'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi/core_foundation.rb:400:in `RubyHashToCFDictionary'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi.rb:103:in `ruby_hash_write_xcode'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist/ffi.rb:40:in `write_to_path'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/plist.rb:46:in `write_to_path'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.0.0.beta.4/lib/xcodeproj/project.rb:332:in `save'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/installer.rb:696:in `block in write_pod_project'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/user_interface.rb:144:in `message'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/installer.rb:688:in `write_pod_project'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/installer.rb:173:in `block in generate_pods_project'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/user_interface.rb:63:in `section'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/installer.rb:167:in `generate_pods_project'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/installer.rb:119:in `install!'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/command/install.rb:37:in `run'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/claide-1.0.0.beta.3/lib/claide/command.rb:334:in `run'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/command.rb:50:in `run'
/Users/rob/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.0.0.beta.8/bin/pod:44:in `<top (required)>'
/Users/rob/.rvm/gems/ruby-2.2.0/bin/pod:23:in `load'
/Users/rob/.rvm/gems/ruby-2.2.0/bin/pod:23:in `<main>'
/Users/rob/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `eval'
/Users/rob/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `<main>'

Most helpful comment

@lanzaiyige Ruby 2.2.3+ fixes it.

All 5 comments

This is a duplicate of https://github.com/CocoaPods/CocoaPods/issues/5037 -- it's a bug in Ruby's FFI implementation that's fixed by newer (2.2.3+ I think) versions of ruby.

Missed that one, thanks @segiddins

I upgrade my ruby version at 2.2.0,but this problem still exist.

@lanzaiyige Ruby 2.2.3+ fixes it.

@iwasrobbed like you said, I upgrade my ruby version to 2.3.0, the problem resolved, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

intelliot picture intelliot  路  3Comments

5SMNOONMS5 picture 5SMNOONMS5  路  3Comments

pronebird picture pronebird  路  3Comments

hmistry picture hmistry  路  3Comments

steffendsommer picture steffendsommer  路  3Comments