当我尝试将 gem 推送到 rubygems 时,我收到一条消息说 gemspec 不允许这样做
when i try to push a gem to rubygems i get a message saying it's not allowed in gemspec when it is
我正在尝试将 gem 推送到 rubygems.org 并收到此消息:
ERROR: "https://rubygems.org" is not allowed by the gemspec, which only allows "Set to 'http://mygemserver.com'"
通用的 mygemserver 条目是 gemspec 的那一行中的默认条目,我已将其更改为 rubygems URL 没有用。
这是我的 gem规格:
# 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 = ["saric.tony@gmail.com\n", "bmg.oak@gmail.com\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
这是我存储库中此文件的副本:
https://github.com/antoniosaric/seed_me_seymour/blob/create/seed_me_seymour.gemspec
我完全不知所措。有其他人 运行 参与其中或知道这里发生了什么吗?谢谢
更新这个以防有人遇到同样的问题。不太确定问题出在哪里,但我最终重新开始了。
我最初使用这些说明来创建我的 gem:
http://bundler.io/rubygems.html
我删除了我的 github 存储库并按照这些说明从头开始:
http://guides.rubygems.org/make-your-own-gem/
此后我能够毫无问题地推动我的 gem。
我正在尝试将 gem 推送到 rubygems.org 并收到此消息:
ERROR: "https://rubygems.org" is not allowed by the gemspec, which only allows "Set to 'http://mygemserver.com'"
通用的 mygemserver 条目是 gemspec 的那一行中的默认条目,我已将其更改为 rubygems URL 没有用。
这是我的 gem规格:
# 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 = ["saric.tony@gmail.com\n", "bmg.oak@gmail.com\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
这是我存储库中此文件的副本:
https://github.com/antoniosaric/seed_me_seymour/blob/create/seed_me_seymour.gemspec
我完全不知所措。有其他人 运行 参与其中或知道这里发生了什么吗?谢谢
更新这个以防有人遇到同样的问题。不太确定问题出在哪里,但我最终重新开始了。
我最初使用这些说明来创建我的 gem:
http://bundler.io/rubygems.html
我删除了我的 github 存储库并按照这些说明从头开始:
http://guides.rubygems.org/make-your-own-gem/
此后我能够毫无问题地推动我的 gem。