gem install gem_name --no-ri --no-rdoc
gem: --no-ri --no-rdoc
$ gem sources --remove https://rubygems.org/ $ gem sources -a http://ruby.taobao.org/ $ gem sources -l
*** CURRENT SOURCES *** http://ruby.taobao.org
source 'http://ruby.taobao.org/' gem 'rails', '3.2.2' ... ... ...
gem update --system #Update to the latest RubyGems version gem build foo.gemspec #Build your gem gem push foo-1.0.0.gem #Deploy your gem instantly
. ├── lib │ └── topico.rb └── topico.gemspec
class Topico def self.hello puts "Hello, RubyGems!" end end
Gem::Specification.new do |s| s.name = 'topico' s.version = '0.0.1' s.date = '2012-03-11' s.summary = 'Greeting from Topico' s.description = 'Topico shows a greeting to RubyGems' s.authors = 'Author Name' s.email = 'username@username.com' s.files = ["lib/topico.rb"] s.homepage = 'http://rubygems.org/gems/topico' end
$ gem build topico.gemspec
Successfully built RubyGem Name: topico Version: 0.0.1 File: topico-0.0.1.gem
. ├── lib │ └── topico.rb ├── topico-0.0.1.gem └── topico.gemspec
$ gem install ./topico-0.0.1.gem
Successfully installed topico-0.0.1 1 gem installed Installing ri documentation for topico-0.0.1... Installing RDoc documentation for topico-0.0.1...
irb(main):001:0> require 'topico' => true irb(main):002:0> Topico.hello Hello, RubyGems! => nil
$ curl -u username https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
Enter host password for user 'username':
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 56 0 56 0 0 25 0 --:--:-- 0:00:02 --:--:-- 144
$ gem push topico-0.0.1.gem
Pushing gem to https://rubygems.org... Successfully registered gem: topico (0.0.1)
. ├── lib │ ├── ext │ │ └── calculation.rb │ └── topico.rb └── topico.gemspec
s.files = ["lib/topico.rb", "lib/ext/calculation.rb"]
$ mkdir bin $ touch bin/greeting $ chmod a+x bin/greeting
#!/usr/bin/env ruby require 'topico' puts Topico.hello
s.executables << 'greeting'
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有