gem push results in "package metadata is missing"
Asked Answered
J

1

5

I'm trying to push my updated gem to rubygems.com and am getting the following result.

 ~/dev/V2/V2GPTI (master) $ gem build v2gpti.gemspec
  Successfully built RubyGem
  Name: v2gpti
  Version: 0.2
  File: v2gpti-0.2-universal-darwin-13.gem
 ~/dev/V2/V2GPTI (master) $ gem push v2gpti.gemspec 
ERROR:  While executing gem ... (Gem::Package::FormatError)
    package metadata is missing in v2gpti.gemspec
 ~/dev/V2/V2GPTI (master) $ 

The only change that I've made to my gem spec since the last push was to add a parseconfig dependency. Here's my gem spec.

Gem::Specification.new do |s|
  s.name        = 'v2gpti'
  s.version     = '0.2'
  s.platform = Gem::Platform.local
  s.summary     = 'Git commands for integration with Pivotal Tracker'
  s.description = 'Provides a set of additional Git commands to help developers when working with Pivotal Tracker'
  s.authors     = ['Ben Hale', 'Jeff Wolski']
  s.email       = '[email protected]'
  s.homepage    = 'https://github.com/v2dev/V2GPTI'
  s.license     = 'Apache-2.0'

  s.files            = %w(LICENSE NOTICE README.md) + Dir['lib/**/*.rb'] + Dir['lib/**/*.sh'] + Dir['bin/*']
  s.executables      = Dir['bin/*'].map { |f| File.basename f }
  s.test_files       = Dir['spec/**/*_spec.rb']

  s.required_ruby_version = '>= 1.8.7'

  s.add_dependency 'highline', '~> 1.6'
  s.add_dependency 'pivotal-tracker', '~> 0.5'
  s.add_dependency 'parseconfig', '~> 1.0'

  s.add_development_dependency 'bundler', '~> 1.3'
  s.add_development_dependency 'rake', '~> 10.0'
  s.add_development_dependency 'redcarpet', '~> 2.2'
  s.add_development_dependency 'rspec', '~> 2.13'
  s.add_development_dependency 'simplecov', '~> 0.7'
  s.add_development_dependency 'yard', '~> 0.8'

Have I left out something in my gemspec?

Janitress answered 1/5, 2014 at 22:19 Comment(3)
It’s not related to your problem, but why do you change the platform to Gem::Platform.local – is it because of the .sh files?Hurwit
It's really because this is my first time creating a gem spec.Janitress
I’ve just had a look at your repo, I don’t think you need the platform entry since the gem is pure Ruby, and by including it you’re restricting it to users who are on the same platform as you are: guides.rubygems.org/specification-reference/#platform=Hurwit
H
20

Don’t push the gemspec, push the actual built gem:

$ gem push v2gpti-0.2-universal-darwin-13.gem
Hurwit answered 1/5, 2014 at 22:23 Comment(1)
I'll try this out as soon at I can yank the bad one. Please see this other question. #23418457Janitress

© 2022 - 2024 — McMap. All rights reserved.