Cheat Sheet速查表
跳转到主要内容

Rubygems 速查表

本文根据 Devhints / Rubygems 翻译。代码示例及版本范围沿用原文。

常用命令 RubyGems CLI 命令。

构建与发布

gem build *.gemspec         # Build a gem
gem install *.gem           # Install locally
gem push *.gem              # Upload to rubygems.org
gem yank foogem -v 0.0.1    # Take it back

查询

gem owner foogem -a rico@ricostacruz.com

gem list                    # List local gems
gem which rake              # Point to where lib/rake.rb is
gem search -r rails         # [remote] Search for gems

打开一个 Gem

# https://github.com/fnando/gem-open
gem open foogem
GEM_EDITOR="vim" gem open foogem

切换到目录

cd $(basename `gem which rake`)  # Go to a gem's path