2016-07-21 10 views
0

私は最初の宝石をコンパイルしてrubygems.orgにプッシュしようとしています。それは私がhttps://rubygems.orgにプッシュすることができないというエラーを投げ続ける:"http://rubygems.org"のみを許可するgemspecでは "https://rubygems.org"は許可されていません

gem build simplesms.gemspec 
WARNING: licenses is empty, but is recommended. Use a license identifier from 
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license. 
WARNING: no homepage specified 
WARNING: See http://guides.rubygems.org/specification-reference/ for help 
    Successfully built RubyGem 
    Name: simplesms 
    Version: 0.1.0 
    File: simplesms-0.1.0.gem 
Toms-MacBook-Pro-2:simplesms t$ gem push simplesms-0.1.0.gem 
Pushing gem to https://rubygems.org... 
ERROR: "https://rubygems.org" is not allowed by the gemspec, which only allows "'http://rubygems.org'" 

しかし、私の仕様で:

# coding: utf-8 
lib = File.expand_path('../lib', __FILE__) 
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 
require 'simplesms/version' 

Gem::Specification.new do |spec| 
    spec.name   = "simplesms" 
    spec.version  = Simplesms::VERSION 
    spec.authors  = ["Tom"] 
    spec.email   = ["[email protected]"] 

    spec.summary  = %q{Easily add sms to your project by integrating the Simple SMS Heroku Addon into your app.} 
    spec.homepage  = "" 

    # 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'] = "'http://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 { |f| f.match(%r{^(test|spec|features)/}) } 
    spec.bindir  = "exe" 
    spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } 
    spec.require_paths = ["lib"] 

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

gemfileで:

source 'http://rubygems.org' 

# Specify your gem's dependencies in simplesms.gemspec 
gemspec 

ただ、私も試したキックのために'https://rubygems.org'に設定しますが、それでも同じエラーが発生します。

私はこれをrubygems.orgにプッシュするために何をする必要がありますか?私はすでに私の電子メール/パスワードでログインし、資格情報が~/.gem/credentials

答えて

3

にこの行です確認:

spec.metadata['allowed_push_host'] = "'http://rubygems.org'" 

あなたは'http://rubygems.org'からallowed_push_hostを設定しています。 http://rubygems.org(一重引用符なし)にする必要があります。それを変更します。

spec.metadata['allowed_push_host'] = "http://rubygems.org" 

あまりにも、代わりにhttps://rubygems.orgを許可しても安全(そして好ましい)でなければなりません。

+0

私はそれを試して誓う!しかし、それは魅力のように働いた!ありがとう:) –

関連する問題