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       = 'jeff@xxxxxxxxx.com'
  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?

Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69
  • 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? – matt May 01 '14 at 22:28
  • It's really because this is my first time creating a gem spec. – Jeff Wolski May 01 '14 at 22:37
  • 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: http://guides.rubygems.org/specification-reference/#platform= – matt May 01 '14 at 22:39

1 Answers1

20

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

$ gem push v2gpti-0.2-universal-darwin-13.gem
matt
  • 78,533
  • 8
  • 163
  • 197
  • I'll try this out as soon at I can yank the bad one. Please see this other question. http://stackoverflow.com/questions/23417957/gem-yank-fails-the-version-does-not-exist – Jeff Wolski May 01 '14 at 22:46