Back to Skills

ruby-gems-bundler

verified

Use when working with Ruby gems, Bundler for dependency management, creating gemspecs, and publishing gems to RubyGems.

View on GitHub

Marketplace

han

TheBushidoCollective/han

Plugin

jutsu-ruby

Technique

Repository

TheBushidoCollective/han
60stars

jutsu/jutsu-ruby/skills/ruby-gems-and-bundler/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/jutsu/jutsu-ruby/skills/ruby-gems-and-bundler/SKILL.md -a claude-code --skill ruby-gems-bundler

Installation paths:

Claude
.claude/skills/ruby-gems-bundler/
Powered by add-skill CLI

Instructions

# Ruby Gems and Bundler

Master Ruby's package management system with gems and Bundler. Learn to manage dependencies, create gems, and publish to RubyGems.

## Bundler Basics

### Gemfile

```ruby
source 'https://rubygems.org'

# Ruby version
ruby '3.3.0'

# Production gems
gem 'rails', '~> 7.1'
gem 'pg', '>= 1.1'
gem 'puma', '~> 6.0'

# Development and test gems
group :development, :test do
  gem 'rspec-rails'
  gem 'factory_bot_rails'
  gem 'faker'
end

# Development only
group :development do
  gem 'rubocop'
  gem 'rubocop-rails'
end

# Test only
group :test do
  gem 'capybara'
  gem 'selenium-webdriver'
end

# Git source
gem 'my_gem', git: 'https://github.com/user/my_gem.git'

# Local path (for development)
gem 'local_gem', path: '../local_gem'

# Specific branch
gem 'experimental_gem', git: 'https://github.com/user/repo.git', branch: 'develop'

# Require specific file or false to not auto-require
gem 'sidekiq', require: 'sidekiq/web'
gem 'bootsnap', require: false
```

### Version Constraints

```ruby
# Exact version
gem 'rails', '7.1.0'

# Pessimistic operator (allows patch updates)
gem 'rails', '~> 7.1.0'  # >= 7.1.0 and < 7.2.0
gem 'rails', '~> 7.1'    # >= 7.1.0 and < 8.0.0

# Greater than or equal
gem 'pg', '>= 1.1'

# Range
gem 'ruby-version', '>= 1.0', '< 2.0'

# Multiple constraints
gem 'nokogiri', '>= 1.10', '< 2.0'
```

### Bundler Commands

```bash
# Install all gems from Gemfile
bundle install

# Install to specific path
bundle install --path vendor/bundle

# Update all gems
bundle update

# Update specific gem
bundle update rails

# Check for outdated gems
bundle outdated

# Show gem location
bundle show rails

# Execute command with bundled gems
bundle exec rspec

# Open gem in editor
bundle open rails

# Check Gemfile syntax
bundle check

# Remove unused gems
bundle clean

# List all installed gems
bundle list

# Show dependency tree
bundle viz
```

### Gemfile.lock

The `Gemfile.lock` file locks gem versions for consistent installations:

```rub

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
8896 chars

Issues Found:

  • name_directory_mismatch