This skill should be used when the user asks about "Bundler", "Gemfile", "Gemfile.lock", "bundle install", "bundle update", "bundle exec", "dependency management", "gem versions", "gem groups", "bundle add", "gem sources", or needs guidance on managing Ruby dependencies.
/plugin marketplace add bastos/ruby-plugin-marketplace/plugin install ruby@ruby-plugin-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Guide to managing Ruby gem dependencies with Bundler.
# Gemfile
source "https://rubygems.org"
# Ruby version (optional but recommended)
ruby "3.2.0"
# Direct dependencies
gem "rails", "~> 7.1"
gem "pg", ">= 1.0"
gem "puma"
# Exact version
gem "rails", "7.1.0"
# Minimum version
gem "pg", ">= 1.0"
# Pessimistic constraint (recommended)
gem "rails", "~> 7.1" # >= 7.1.0, < 8.0
gem "rails", "~> 7.1.0" # >= 7.1.0, < 7.2.0
gem "rails", "~> 7.1.2.3" # >= 7.1.2.3, < 7.1.3.0
# Combined constraints
gem "nokogiri", ">= 1.12", "< 2.0"
# Any version (not recommended)
gem "puma"
# Default group (always installed)
gem "rails"
# Named groups
group :development do
gem "better_errors"
gem "binding_of_caller"
end
group :test do
gem "rspec-rails"
gem "capybara"
end
group :development, :test do
gem "factory_bot_rails"
gem "faker"
end
group :production do
gem "redis"
end
# Skip groups during install
bundle config set --local without development test
bundle install
# Or inline
bundle install --without development test
source "https://rubygems.org"
# Private gem server
source "https://gems.example.com" do
gem "private_gem"
end
# From GitHub (shorthand)
gem "rails", github: "rails/rails"
gem "rails", github: "rails/rails", branch: "main"
gem "rails", github: "rails/rails", tag: "v7.1.0"
gem "rails", github: "rails/rails", ref: "abc123"
# Full git URL
gem "my_gem", git: "https://github.com/user/my_gem.git"
gem "my_gem", git: "git@github.com:user/my_gem.git"
# Specific subdirectory
gem "my_gem", github: "user/monorepo", glob: "gems/my_gem/*.gemspec"
# For development
gem "my_gem", path: "../my_gem"
gem "my_gem", path: "~/projects/my_gem"
# Only on specific platforms
gem "bcrypt", platforms: :ruby
gem "wdm", platforms: :mswin
# Exclude platforms
gem "sqlite3", platforms: [:ruby, :mswin]
# Common platforms:
# :ruby - C Ruby (MRI), Rubinius
# :mri - Only MRI
# :jruby - JRuby
# :mswin - Windows
# :mingw - MinGW
# :x64_mingw - 64-bit MinGW
# In Gemfile
ruby "3.2.0"
# With engine
ruby "3.2.0", engine: "jruby", engine_version: "9.4.0"
# Version constraint
ruby "~> 3.2.0"
GEM
remote: https://rubygems.org/
specs:
actionpack (7.1.0)
actionview (= 7.1.0)
activesupport (= 7.1.0)
rack (~> 2.2)
PLATFORMS
arm64-darwin-22
x86_64-linux
DEPENDENCIES
rails (~> 7.1)
RUBY VERSION
ruby 3.2.0p0
BUNDLED WITH
2.4.0
# Add platform
bundle lock --add-platform x86_64-linux arm64-darwin
# Remove platform
bundle lock --remove-platform x86_64-linux
# Update lock file for all platforms
bundle lock --update
# Install gems from Gemfile.lock
bundle install
# Update all gems
bundle update
# Update specific gems
bundle update rails pg
# Conservative update (minimal changes)
bundle update --conservative rails
# Update only patch versions
bundle update --patch
# Update minor versions
bundle update --minor
# Show gem info
bundle info rails
# Show dependency tree
bundle show
# List all gems
bundle list
# Show outdated gems
bundle outdated
# Check for security issues
bundle audit
# Run command with bundled gems
bundle exec rails server
bundle exec rspec
# Create binstubs
bundle binstubs rspec-core
bin/rspec # Faster than bundle exec
# Open gem in editor
EDITOR=code bundle open rails
# Set configuration
bundle config set --local path vendor/bundle
bundle config set --local without development test
# View configuration
bundle config list
# Unset configuration
bundle config unset path
# Install gems locally (not system-wide)
bundle config set --local path vendor/bundle
# Parallel installation
bundle config set --local jobs 4
# Disable shared gems
bundle config set --local disable_shared_gems true
# Use system gems
bundle config set --local system true
# .bundle/config
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_WITHOUT: "development:test"
BUNDLE_JOBS: "4"
# Clear cache and reinstall
rm -rf vendor/bundle .bundle Gemfile.lock
bundle install
# Reinstall all gems
bundle install --redownload
# Debug resolution
bundle install --verbose
# Check for conflicts
bundle check
# Error: Bundler could not find compatible versions
# Solutions:
# 1. Update the conflicting gem
bundle update conflicting_gem
# 2. Relax version constraints
# Change "~> 1.0.0" to "~> 1.0"
# 3. Check dependency tree
bundle viz # Requires graphviz
# If native extension fails
bundle config build.nokogiri --use-system-libraries
bundle install
# Provide library paths
bundle config build.pg --with-pg-config=/usr/local/bin/pg_config
# Good: Pessimistic constraints allow updates
gem "rails", "~> 7.1"
# Avoid: Exact versions prevent updates
gem "rails", "7.1.0"
# Avoid: No constraint is risky
gem "rails"
# Keep groups focused
group :development do
# Development tools only
end
group :test do
# Testing tools only
end
group :development, :test do
# Shared tools (factories, debugging)
end
Gemfile.lockbundle update to get security patches# Fast CI install
bundle config set --local frozen true
bundle config set --local deployment true
bundle install --jobs 4 --retry 3
| Gemfile | Gemfile.lock |
|---|---|
| Dependencies you want | Exact versions resolved |
| Version constraints | Specific versions |
| Human-edited | Machine-generated |
| Flexible | Deterministic |
| What you need | What you have |
Always commit both files. The lock file ensures everyone uses identical gem versions.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.