Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Invalid `<pod_name>.podspec` file: undefined method `author=' for #<Pod::Specification name="<pod_name>"> #816

Closed
sirnicolaz opened this Issue · 16 comments

6 participants

@sirnicolaz

This morning I updated my RubyGems to the latest version and then updated Cocoapods to 0.17.0.rc1. When I tried then to run pod install I got that error message.

I tried to remove that dependency, but I got a similar error for almost all the other dependencies (in some of them "framework" was the undefined method, for instance).

I tried then to rollback to Cocoapods 0.16.4, but still the same.

Also with older versions of RubyGems now I get the same error (honestly, I don't remember which one was the version I was using before upgrading this morning).

Could anyone give me an hint on how to fix this thing? I'm completely lost.

I'm using ruby-1.9.3-p194 and Mac OSX 10.7.5. Thanks

@sirnicolaz sirnicolaz closed this
@sirnicolaz

I reinstalled everything over and recloned the specs repo, now it works

@sirnicolaz sirnicolaz reopened this
@sirnicolaz

I reinstalled everything over and recloned the specs repo, now it works

@sirnicolaz sirnicolaz closed this
@fabiopelosin

I was just writing a reply... strange issue.

@tonyxiao

+1, have the same issue.

@fabiopelosin fabiopelosin reopened this
@fabiopelosin

We had another report similar to this issue and a reinstallation of CocoaPods fixed the issue. I guess that for some reason the cocoapods-core gem might not be correctly loaded. I also assume that this issue is somehow related to the pre-release installation process of RubyGems. Therefore I'm closing it with the suggestion to re-install cocoapods to those who encounter it. If more information is found please share it.

@normanhh3

Just FYI, I ran into this issue just now after having installed the 0.17.rc6 version. I had about 6 versions of Cocoapods installed however and I suppose it is possible that they may have confligrated with one another in the bowels of my directory tree. I just removed all versions, installed the 0.17.rc6 pre release version and have the same error.

I also did a

pod setup

which picked up a few updates on the master spec repo but nothing related to the BlocksKit spec. I can fix this by adding a simple "s" to the end of s.author and that would fix it, but I'm afraid that there are quite a few more specs in the master repo with this version!

Invalid `BlocksKit.podspec` file: undefined method `author=' for #<Pod::Specification name="BlocksKit">
 #
 #  from /Users/nharebottl/.cocoapods/master/BlocksKit/1.8.1/BlocksKit.podspec:7
 #  -------------------------------------------
 #    s.homepage              = 'https://github.com/pandamonia/BlocksKit'
 >    s.author                = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
 #                                'Alexsander Akers' => 'a2@pandamonia.us' }
 #  -------------------------------------------
 #

Final note on recloning - the files in my repo are up-to-date as of the latest push tonight.

commit 86271c6
Author: Keith Smiley keithbsmiley@gmail.com
Date: Mon Mar 25 21:47:39 2013 -0400

and the files here in master on github match what I've got in the files in my repo, so that won't help either. Is this something that is an example of an attribute that has been deprecated in favor of a single authors method and there are repos yet to be fixed?

@fabiopelosin

I just removed all versions, installed the 0.17.rc6 pre release version and have the same error.

Can you do the same process for the cocoapods-core gem. I think that the issue is related to the cocoapods gem not loading the correct version of the cocoapods-core gem (possibly due to an incorrect resolution of pre-release versions).

I can fix this by adding a simple "s" to the end of s.author and that would fix it, but I'm afraid that there are quite a few more specs in the master repo with this version!

Please don't, the plural variants of the DSL directives is a supported feature.

@fabiopelosin fabiopelosin reopened this
@normanhh3

I went to uninstall cocoapods-core but it was showing as version (0.17.0.rc6)

gem uninstall cocoapods-core 
gem uninstall cocoapods-downloader

got those removed and then performed a

gem install cocoapods
pod update

Still running into the same "author undefined" issue.

Stack information that might be relevant?

Stack

   CocoaPods : 0.17.0.rc6
        Ruby : ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]
    RubyGems : 1.8.24
        Host : Mac OS X 10.7.5 (11G63)
       Xcode : 4.6 (4H127)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ d0e269df70360253039ab17dc6f1fddd2830faca

Error

Pod::DSLError - Invalid `BlocksKit.podspec` file: undefined method `author=' for #<Pod::Specification name="BlocksKit">
 #
 #  from /Users/nharebottl/.cocoapods/master/BlocksKit/1.8.1/BlocksKit.podspec:7
 #  -------------------------------------------
 #    s.homepage              = 'https://github.com/pandamonia/BlocksKit'
 >    s.author                = { 'Zachary Waldowski' => 'zwaldowski@gmail.com',
 #                                'Alexsander Akers' => 'a2@pandamonia.us' }
 #  -------------------------------------------
 #
/Users/nharebottl/.cocoapods/master/BlocksKit/1.8.1/BlocksKit.podspec:7:in `_eval_podspec'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/specification.rb:47:in `initialize'
/Users/nharebottl/.cocoapods/master/BlocksKit/1.8.1/BlocksKit.podspec:1:in `new'
/Users/nharebottl/.cocoapods/master/BlocksKit/1.8.1/BlocksKit.podspec:1:in `_eval_podspec'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/specification.rb:541:in `eval'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/specification.rb:592:in `_eval_podspec'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/specification.rb:541:in `from_file'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/specification/set.rb:88:in `specification'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source.rb:141:in `search'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source.rb:26:in `find'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source.rb:136:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source.rb:136:in `find'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source.rb:136:in `search'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source/aggregate.rb:104:in `search'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source/aggregate.rb:104:in `select'
/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/source/aggregate.rb:104:in `search'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.0.rc6/lib/cocoapods/sources_manager.rb:41:in `search'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.0.rc6/lib/cocoapods/command/outdated.rb:32:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.0.rc6/lib/cocoapods/command/outdated.rb:31:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.0.rc6/lib/cocoapods/command/outdated.rb:31:in `run'
/Library/Ruby/Gems/1.8/gems/claide-0.2.0/lib/claide.rb:535:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.0.rc6/lib/cocoapods/command.rb:36:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.0.rc6/bin/pod:16
/usr/bin/pod:23:in `load'
/usr/bin/pod:23

Could I be using a different Ruby version that could be causing this issue?

@alloy
Owner

Could I be using a different Ruby version that could be causing this issue?

Maybe. In your original post you said:

I'm using ruby-1.9.3-p194

But as can be seen from the paths in the stack trace, you are actually using the system Ruby. I’m not sure what’s happening, though, because it does look like it’s using the correct gems.

@alloy
Owner

FWIW, it works from my end with BlocksKit:

~/t/Test816 » pod --version
0.17.0.rc6
~/t/Test816 » cat Podfile
platform :ios, '6.0'
pod 'BlocksKit'
~/t/Test816 » pod install --no-doc --no-integrate
Analyzing dependencies
Downloading dependencies
Installing BlocksKit (1.8.1)
Installing libffi (3.0.11)
Generating Pods project
@fabiopelosin

This is driving me nuts!

Some interesting methods:

@normanhh3 It would be great if you could modify the following line:

/Library/Ruby/Gems/1.8/gems/cocoapods-core-0.17.0.rc6/lib/cocoapods-core/specification.rb:463

With the following:

    DSL.attributes.values.each do |a|
puts "attribute = #{a}"
      define_method(a.writer_name) do |value|
        store_attribute(a.name, value)
      end

      if a.writer_singular_form
puts "a.writer_singular_form = #{a.writer_singular_form}"
        alias_method(a.writer_singular_form, a.writer_name)
      end
    end

The only thing that I can think of is the String#singularize not working properly maybe because there is an old version of active_support in the system.

@normanhh3

It appears that I ended up running a

gem update

Which did include an update to activesupport and it appears that may have solved this issue because I am now getting past that bug.

My current activesupport version(s)

gem list activesupport

*** LOCAL GEMS ***

activesupport (3.2.13, 3.2.6)

My new cocoapod is breaking - but that isn't the fault of this new release!

@alloy
Owner

Yup, that’s it. I can confirm that I get the same error with ActiveSupport 3.2.6. It works correct with >= 3.2.7, so we should probably bump the version requirement to the current version.

@alloy alloy closed this in ebcd819
@alloy
Owner

@normanhh3 Thanks for helping us get to the root cause!

@fabiopelosin fabiopelosin referenced this issue from a commit
@fabiopelosin fabiopelosin Merge branch 'master' of github.com:CocoaPods/CocoaPods
* 'master' of github.com:CocoaPods/CocoaPods:
  Bump ActiveSupport dependency to *not* be 3.2.6, which has an inflector bug. Fixes #816.
6dc02bd
@normanhh3

Awesome to see the changeset in so fast! :-) Nice work, glad to be of service. Cocoapods is a great little package management tool.

@scottkacyn

Can you guys make this a question/answer on Stackoverflow? Spent a long time looking around for this issue. Appreciate the commentary in here. Thanks.

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.