.gitignore for Ruby

26 ignore rules for Ruby, ready to copy into your repository.

Dynamic programming language

The complete .gitignore for Ruby

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:27:18 UTC
# Technologies: Ruby

### Ruby ###
# Ruby gem package
*.gem
# Ruby compiled bytecode
*.rbc
# Configuration directory
/.config
# Installed files list
/InstalledFiles
# Package directory
/pkg/
# Test reports
/spec/reports/
# Code coverage reports
/coverage/
# RSpec examples
/spec/examples.txt
# Test temporary files
/test/tmp/
# Test version temp
/test/version_tmp/
# Temporary directory
/tmp/
# Data files
.dat*
# REPL history
.repl_history
# Build output directory
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/
/.yardoc/
/_yardoc/
/doc/
/rdoc/
/.bundle/
# Bundled gems
/vendor/bundle
/lib/bundler/man/
# RVM configuration
.rvmrc
.byebug_history

What these Ruby rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

General

Pattern What it ignores
*.gem Ruby gem package
*.rbc Ruby compiled bytecode
/.config Configuration directory
/InstalledFiles Installed files list
/pkg/ Package directory
/spec/reports/ Test reports
/coverage/ Code coverage reports
/spec/examples.txt RSpec examples
/test/tmp/ Test temporary files
/test/version_tmp/ Test version temp
/tmp/ Temporary directory

Ignore Byebug command history file.

Pattern What it ignores
.dat* Data files
.repl_history REPL history
build/ Build output directory
*.bridgesupport Ignore Byebug command history file.
build-iPhoneOS/ Ignore Byebug command history file.
build-iPhoneSimulator/ Ignore Byebug command history file.
/.yardoc/ # Documentation cache and generated files:
/_yardoc/ Ignore Byebug command history file.
/doc/ Ignore Byebug command history file.
/rdoc/ Ignore Byebug command history file.
/.bundle/ # Environment normalization:
/vendor/bundle Bundled gems
/lib/bundler/man/ Ignore Byebug command history file.
.rvmrc RVM configuration
.byebug_history Ignore Byebug command history file.

How to use this .gitignore for Ruby

  1. Copy the Ruby rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other Language .gitignore templates

See every Language template