Forum: Ruby undefined method `empty?' for nil:NilClass in gem build

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
851acbab08553d1f7aa3eecad17f6aa9?d=identicon&s=25 Ken Bloom (Guest)
on 2009-05-20 19:09
(Received via mailing list)
I'm trying to build a rubygem, but I keep getting the following error.
Can anybody help?

$ gem build wordnet.gemspec
ERROR:  While executing gem ... (NoMethodError)
    undefined method `empty?' for nil:NilClass

$ cat wordnet.gemspec
Gem::Specification.new do |s|
  s.name="WordNet"
  s.author="Ken Bloom"
  s.email="kbloom@gmail.com"
  s.version="1.0.1"
  s.summary="A binding to the WordNet C library"
  s.require_path="ext"

  #disabled because it spews lots of errors
  #but the generated rdoc isn't useful in the least
  s.has_rdoc=false

  s.files += Dir["ext/*"]
  s.extensions << "ext/extconf.rb"
end

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.2
  - RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.8
     - /home/bloom/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2009-05-20 21:12
(Received via mailing list)
On May 20, 2009, at 10:08, Ken Bloom wrote:

>  s.author="Ken Bloom"
>  s.email="kbloom@gmail.com"
>  s.version="1.0.1"
>  s.summary="A binding to the WordNet C library"
>  s.require_path="ext"
>
>  #disabled because it spews lots of errors
>  #but the generated rdoc isn't useful in the least
>  s.has_rdoc=false

Note that RDoc 1.3.3 ignores this setting and always generates RDoc.

DON'T be lazy, document your code!  (You may want to install RDoc 2 if
you're getting warnings)

>  s.files += Dir["ext/*"]
>  s.extensions << "ext/extconf.rb"
> end
>
> $ gem environment
> RubyGems Environment:
>  - RUBYGEMS VERSION: 1.3.2

Maybe there's a bug in 1.3.2, try upgrading:

$ touch ext/extconf.rb

NOTE: DON'T be lazy, do it right!  You forgot to specify all these
things.  Filling them in is in the best interests of everyone.

$ gem build wordnet.gemspec
WARNING:  no description specified
WARNING:  no homepage specified
WARNING:  no rubyforge_project specified
   Successfully built RubyGem
   Name: WordNet
   Version: 1.0.1
   File: WordNet-1.0.1.gem
$ gem env version
1.3.3
851acbab08553d1f7aa3eecad17f6aa9?d=identicon&s=25 Ken Bloom (Guest)
on 2009-05-21 03:09
(Received via mailing list)
On Thu, 21 May 2009 04:11:27 +0900, Eric Hodel wrote:

> On May 20, 2009, at 10:08, Ken Bloom wrote:
>
>> I'm trying to build a rubygem, but I keep getting the following error.
>> Can anybody help?
>>
>> $ gem build wordnet.gemspec
>> ERROR:  While executing gem ... (NoMethodError)
>>    undefined method `empty?' for nil:NilClass

>    File: WordNet-1.0.1.gem
> $ gem env version
> 1.3.3

It was the missing homepage field.

But failure to specify a homepage or rubyforge_project shouldn't be
considered lazy, when some projects don't have one becuase they're not
released yet, or (for the rubyforge_probject) when they're released
somehere other than Rubyforge, such as GitHub.

--Ken
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2009-05-21 22:55
(Received via mailing list)
On May 20, 2009, at 18:08, Ken Bloom wrote:
>> NOTE: DON'T be lazy, do it right!  You forgot to specify all these
>> $ gem env version
>> 1.3.3
>
> It was the missing homepage field.
>
> But failure to specify a homepage or rubyforge_project shouldn't be
> considered lazy, when some projects don't have one becuase they're not
> released yet,

That's why you only get a warning.

> or (for the rubyforge_probject) when they're released
> somehere other than Rubyforge, such as GitHub.

If a gem doesn't show up in `gem list -r` using RubyGems' default
sources it's not released.
This topic is locked and can not be replied to.