よっしゃ!bundle exec rake release
だ!
なんだこのエラーは・・・。
$ bundle exec rake release
sample_gem 0.1.0 built to pkg/sample_gem-0.1.0.gem.
Tag v0.1.0 has already been created.
rake aborted!
ERROR: "https://rubygems.org" is not allowed by the gemspec, which only allows "TODO: Set to 'http://mygemserver.com'"
Pushing gem to https://rubygems.org...
Tasks: TOP => release => release:rubygem_push
(See full trace by running task with --trace)
原因はなにか
これは誤ってオレオレgemをrubygems.orgにpushしないための設定が
$ bundle gem sample_gem
した時に下記のように記述されているためです。
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.$
if spec.respond_to?(:metadata)$
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
else
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
end
どんなホストにでもpushしていいならここのセクション消してねって書いてありますね!ここを消せばとりあえずrubygemsにpushできます。