Skip to content
This repository

Undefined method `author=' on 10.9 #1340

Closed
dominikkrejcik opened this Issue · 15 comments

8 participants

Dominik Krejcik Fabio Pelosin motephyr Lucas Lazaro rob phillips Adarsh Solanki Kyle Fuller Josh Glick
Dominik Krejcik

Report

I was using CocoaPods 0.24 on OSX 10.9 with Ruby 2.0.0p247. When running pod update or pod install I got the following error. Downgrading pods to 0.23 fixes the issue.

Stack

   CocoaPods : 0.24.0
        Ruby : ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.0.0]
    RubyGems : 2.0.7
        Host : Mac OS X 10.9 (13A569)
       Xcode : 5.0 (5A11386k)
Ruby lib dir : /Users/domk/.rvm/rubies/ruby-2.0.0-p247/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 75e6cea1f86a62e0d76669fcf252adacb61eb38c

Podfile

platform :ios, '6.0'

inhibit_all_warnings!

pod 'AFNetworking', '~> 1.3'
pod 'AFHTTPRequestOperationLogger', '~> 0.10'
pod 'SSKeychain', '~> 1.2'
pod 'MBProgressHUD', '~> 0.6'
pod 'TSMessages', '~> 0.9'
pod 'Underscore.m', '~> 0.2'
pod 'PHFComposeBarView', '~> 1.1'

Error

Pod::DSLError - Invalid `SSKeychain.podspec` file: undefined method `author=' for #<Pod::Specification name="SSKeychain">
 #
 #  from /Users/domk/.cocoapods/repos/master/SSKeychain/1.2.0/SSKeychain.podspec:6
 #  -------------------------------------------
 #    spec.homepage     = 'https://github.com/soffes/sskeychain'
 >    spec.author       = { 'Sam Soffes' => 'sam@soff.es' }
 #    spec.source       = { :git => 'https://github.com/soffes/sskeychain.git', :tag => "v#{spec.version}" }
 #  -------------------------------------------
 #
/Users/domk/.cocoapods/repos/master/SSKeychain/1.2.0/SSKeychain.podspec:6:in `block in _eval_podspec'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/specification.rb:40:in `initialize'
/Users/domk/.cocoapods/repos/master/SSKeychain/1.2.0/SSKeychain.podspec:1:in `new'
/Users/domk/.cocoapods/repos/master/SSKeychain/1.2.0/SSKeychain.podspec:1:in `_eval_podspec'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/specification.rb:608:in `eval'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/specification.rb:608:in `_eval_podspec'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/specification.rb:558:in `from_string'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/specification.rb:541:in `from_file'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/specification/set.rb:88:in `specification'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/source.rb:156:in `block in search'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/source.rb:151:in `each'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/source.rb:151:in `find'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/source.rb:151:in `search'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/source/aggregate.rb:104:in `block in search'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/source/aggregate.rb:104:in `select'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.24.0/lib/cocoapods-core/source/aggregate.rb:104:in `search'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:191:in `find_cached_set'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:153:in `block (2 levels) in find_dependency_specs'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/user_interface.rb:113:in `message'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:152:in `block in find_dependency_specs'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:148:in `each'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:148:in `find_dependency_specs'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:65:in `block (2 levels) in resolve'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:63:in `block in resolve'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:62:in `each'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/resolver.rb:62:in `resolve'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/installer/analyzer.rb:284:in `block in resolve_dependencies'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/installer/analyzer.rb:282:in `resolve_dependencies'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/installer/analyzer.rb:56:in `analyze'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/installer.rb:171:in `analyze'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/installer.rb:94:in `block in resolve_dependencies'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/installer.rb:93:in `resolve_dependencies'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/installer.rb:86:in `install!'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/command/project.rb:82:in `run'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide/command.rb:206:in `run'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/lib/cocoapods/command.rb:51:in `run'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.24.0/bin/pod:19:in `<top (required)>'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/bin/pod:23:in `load'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/bin/pod:23:in `<main>'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/Users/domk/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
Fabio Pelosin

This is quite puzzling. Is the issue still present if you upgrade again?

motephyr

I hava the same problem about "author" and "framework".
like alias fail? i feel that ruby 2.0 lead to it

Fabio Pelosin

I have been using CocoaPods on Ruby 2.0.0p247 for while so I would rule out this possibility. However I use it on 10.8 so it might be an issue specific to 10.9.

Lucas Lazaro

Same error here using ruby 1.9.3p429 and OSX 10.8.4

rob phillips

+1 I had this problem doing a fresh install and then my co-worker had the same issue

Mine was resolved after upgrading to the latest ruby, running gem update and then installing latest Cocoapods.

Fabio Pelosin

Can you confirm that if you pluralize the attribute the issue goes away?

Fabio Pelosin

i.e. authors

Adarsh Solanki

I had this issue, and I can confirm that pluralizing attribute fixes issue. This was an error for me on the following pods:

  • RestKit 0.20.3
  • SOCKit 1.1 *OHAttributedLabel 3.4.3 ( + framework vs frameworks)
  • SVPullToRefresh 0.4.1

The above are all the issue of "author" vs "authors" key in /var/root/.cocoapods/repos/master/PROJECT/VERSION/PROJECT.podspec file.

How can these be fixed for future users?

Fabio Pelosin

This problem which I can't reproduce is related to CocoaPods not declaring the singular forms of the attributes in some systems. Can somebody affected by the issue post the output of:

$ gem query --local -n activesupport
Kyle Fuller
Owner

@irrationalfab if this is the case, as mentioned before. We should run the tests on both the maximum and minimum version of dependencies to catch stuff like this. Do you have any idea how that's possible with travis/gems?

Adarsh Solanki

gem query --local -n activesupport

*** LOCAL GEMS ***

activesupport (4.0.0, 3.2.14)

Fabio Pelosin

@asolanki Strange, I still don't have an explanation for this issue.

Can somebody help with some rudimental debugging patching these lines of the gems/cocoapods-core-0.24.0/lib/cocoapods-core/specification.rb file (you can get the full path with in the backtrace printed by the crash) with the following?

 DSL.attributes.values.each do |a|
+  puts "Declaring writer for attribute with name: #{a.name} (singular: #{a.name.to_s.singularize})"
+  puts "Declaring singular form writer: #{a.writer_singular_form}" if a.writer_singular_form
   define_method(a.writer_name) do |value|
     store_attribute(a.name, value)
   end

   if a.writer_singular_form
     alias_method(a.writer_singular_form, a.writer_name)
   end
 end

Fabio Pelosin

The expected output which should be printed at the top of the output of the CocoaPods command should be:

Declaring writer for attribute with name: name (singular name)
Declaring writer for attribute with name: version (singular version)
Declaring writer for attribute with name: authors (singular author)
Declaring singular form writer: author=
[...]
Josh Glick

Hey. I had this issue and was struggling to find a solution. I tried upgrading to new Ruby through brew and had no luck so I had someone (much smarter than me) help me go back to Ruby.

For me the solution ended up deleting all of my local gems (admittedly, I'm not a ruby dev so this was easy for me) and then reinstalling the cocoapods gem. I wish I had a gem list from before but I don't sorry.

Good luck

Fabio Pelosin

This should have been fixed if I recall correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.