Reputation: 65
I'm trying to publish my gem. Looks like I'm having two errors.
Failed to load /Users//.gemrc because it doesn't contain valid YAML hash
ERROR: While executing gem ... (Gem::CommandLineError)
Too many gem names (/Users//Documents/Projects/Gems/Pirateme/pkg/.gem, Set, to, http://mygemserver.com); please specify only one
Anyone can shine some light to it? Not sure, I restarted the gem a few times.
Upvotes: 4
Views: 1108
Reputation: 351
I'm a bit late, but maybe this will help someone else. I had the same error and the following change in my .gemspec
file worked for me. Just needed to specify the push host, since rake release
is preparing our gem before pushing it (and that second part would be hard without a push location specified).
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
Upvotes: 1
Reputation: 2536
I've the same error without any .gemrc
but I removed those lines from <my_gem>.gemspec
# 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'] = "TODO: Set to 'http://mygemserver.com'"
else
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
end
And it's works
Upvotes: 4