RubyGems is the official package management framework and registry for Ruby libraries.
Building & Publishing Gems
# Build .gem binary from specification
gem build my_gem.gemspec
# Install built gem locally
gem install my_gem-1.0.0.gem
# Push gem to RubyGems.org registry
gem push my_gem-1.0.0.gem
# Remove / yank a specific version from index
gem yank my_gem -v 1.0.0
Managing Installed Gems
# Search remote registry for gems
gem search '^rails' --remote
# List all locally installed gems
gem list
# Check which version of a gem is currently active
gem which rake
# Update specific gem
gem update bundler
# Clean up old gem versions
gem cleanup
Environment & Configuration
# Display RubyGems environment details and gem path
gem env
# Gem cache and installation directory
gem env home