make your own gem

 

 

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

 

按照官方给出的步骤,建立一个自己的gem包,本地安装比较简单,一看就懂

说一下发布到rubygems上

首先:注册一个 rubygems的账号

会自动生成

 

curl -u michael_roshen_cc https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials

 

执行后 gem push hola-0.0.0.gem即可

 

我这里比较顺利,如果出现问题,也给出了解决方案:

If you’re having problems with curl, OpenSSL, or certificates, you might want to simply try entering the above URL in your browser’s address bar. Your browser will ask you to login to RubyGems.org. Enter your username and password. Your browser will now try to download the file api_key.yaml. Save it in ~/.gem and call it ‘credentials’

这样发布成功以后就可以直接使用 gem install hola-0.0.0.gem 来进行安装了

 

 

 

 

你可能感兴趣的:(gem)