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 = "XXX" //作者 
spec.email = "XXXX@163.com" 
spec.homepage 
= www.cnblogs.com 
spec.files 
= Dir['lib/*.rb'//位于lib子文件夹下的所有.rb文件 
spec.version = "1.0.0" //版本号 
end 

 

安装 gem install install.rb

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2021-07-04
  • 2021-08-15
  • 2022-12-23
  • 2021-09-28
  • 2021-07-22
猜你喜欢
  • 2021-09-05
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2021-06-05
  • 2021-07-20
相关资源
相似解决方案