Search code examples
rubygemsgemspecs

when i try to push a gem to rubygems i get a message saying it's not allowed in gemspec when it is


I'm trying to push a gem to rubygems.org and get this message:

ERROR:  "https://rubygems.org" is not allowed by the gemspec, which only allows "Set to 'http://mygemserver.com'"

that generic mygemserver entry is the default entry in that line of the gemspec, which I've changed to the rubygems URL to no avail.

Here is my gemspec:

# coding: utf-8



lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
# require 'seed_me_seymour/version'

Gem::Specification.new do |spec|
  spec.name          = "seed_me_seymour"
  spec.version       = SeedMeSeymour::VERSION
  spec.authors       = ["Tony S.", "Brandon G." ]
  spec.email         = ["[email protected]\n", "[email protected]\n"]

  spec.summary       = %q{This gem will analyze your current database and make a seed file with pre-populated seed information using faker}
  spec.homepage      = "https://github.com/antoniosaric/seed_me_seymour"

  # Prevent pushing this gem to   RubyGems.org. To allow pushes either set the 'allowed_push_host'
  # to allow pushing to a single host or delete this section to allow pushing to any host.
  if spec.respond_to?(:metadata)
    spec.metadata['allowed_push_host'] = "https://rubygems.org"
  else
    raise "RubyGems 2.0 or newer is required to protect against " \
      "public gem pushes."
  end

  spec.files         = `git ls-files -z`.split("\x0").reject do |f|
    f.match(%r{^(test|spec|features)/})
  end
  spec.bindir        = "exe"
  spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
  spec.require_paths = ["lib"]

  spec.add_development_dependency "bundler", "~> 1.14"
  spec.add_development_dependency "rake", "~> 10.0"
end

Here's the copy of this file in my repo:

https://github.com/antoniosaric/seed_me_seymour/blob/create/seed_me_seymour.gemspec

I'm at a total loss. Has anyone else run into this or know what's going on here? thanks


Solution

  • Updating this in case someone hits the same issue. Not really sure what the issue was, but I ended up starting over again.

    I initially used these instructions to create my gem:
    http://bundler.io/rubygems.html

    I wiped my github repo out and started from scratch with these instructions:

    http://guides.rubygems.org/make-your-own-gem/

    I was able to push my gem up with no problem after this.