ruby打包成gem

gem 打包:
gem build xxx.rb
gem 安装:
gem install xxx.rb
例如:

运行->CMD->转到需要打包的文件夹下->gem build install.rb
instal.rb代码
require 'rubygems'
spec = Gem::Specification.new do |spec|
spec.name='ganjiang'   //gem名称
spec.summary = "Hello! Ruby!" //gem概述
spec.description = %{This is my first gem!} //gem用途
spec.author = "ganjiang" //作者
spec.email = "[email protected]"
spec.homepage = "www.183ww.com"
spec.files = Dir['lib/*.rb'] //位于lib子文件夹下的所有.rb文件
spec.version = "1.0.0" //版本号
end
安装 gem install install.rb

你可能感兴趣的:(Ruby,rubygems)