Skip to content
framework38 active rulesVerified 2026-09-30

Ruby on Rails .gitignore Template

Rails log files, temporary storage (/tmp), asset caches, and credentials. Generated and merged deterministically with upstream GitHub repository patterns to keep your repository clean of package directories, temporary build artifacts, and local environment files.

Interactive Stack Generator

Preconfigured with Ruby on Rails
Search for templates
Quick add:
Selected1
Ruby on Rails
Selected Templates (1)
.gitignore
38 rules
### Ruby on Rails ###
*.rbc
capybara-*.html
.rspec
/db/*.sqlite3
/db/*.sqlite3-journal
/db/*.sqlite3-[0-9]*
/public/system
/coverage/
/spec/tmp
*.orig
rerun.txt
pickle-email-*.html
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
config/initializers/secret_token.rb
config/master.key
# Only include if you have production secrets in this file, which is no longer a Rails default
# config/secrets.yml
# dotenv, dotenv-rails
# TODO Comment out these rules if environment variables can be committed
.env
.env*.local
## Environment normalization:
/.bundle
/vendor/bundle
# these should all be checked in to normalize the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
# if using bower-rails ignore default bower_components path bower.json files
/vendor/assets/bower_components
*.bowerrc
bower.json
# Ignore pow environment settings
.powenv
# Ignore Byebug command history file.
.byebug_history
# Ignore node_modules
node_modules/
# Ignore precompiled javascript packs
/public/packs
/public/packs-test
/public/assets
# Ignore yarn files
/yarn-error.log
yarn-debug.log*
.yarn-integrity
# Ignore uploaded files in development
/storage/*
!/storage/.keep
/public/uploads
71 lines•UTF-8
Deterministic

Raw Ruby on Rails .gitignore

Crawlable upstream source template
rails.gitignore•70 lines•UTF-8
*.rbc
capybara-*.html
.rspec
/db/*.sqlite3
/db/*.sqlite3-journal
/db/*.sqlite3-[0-9]*
/public/system
/coverage/
/spec/tmp
*.orig
rerun.txt
pickle-email-*.html
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
config/initializers/secret_token.rb
config/master.key
# Only include if you have production secrets in this file, which is no longer a Rails default
# config/secrets.yml
# dotenv, dotenv-rails
# TODO Comment out these rules if environment variables can be committed
.env
.env*.local
## Environment normalization:
/.bundle
/vendor/bundle
# these should all be checked in to normalize the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
# if using bower-rails ignore default bower_components path bower.json files
/vendor/assets/bower_components
*.bowerrc
bower.json
# Ignore pow environment settings
.powenv
# Ignore Byebug command history file.
.byebug_history
# Ignore node_modules
node_modules/
# Ignore precompiled javascript packs
/public/packs
/public/packs-test
/public/assets
# Ignore yarn files
/yarn-error.log
yarn-debug.log*
.yarn-integrity
# Ignore uploaded files in development
/storage/*
!/storage/.keep
/public/uploads

Key Pattern Breakdown

Dependencies & Package Registries

External libraries and package manager directories installed locally rather than stored in version control.

/vendor/bundle/vendor/assets/bower_componentsnode_modules/

Build Outputs & Compiled Artifacts

Generated binary files, compilation targets, and distribution bundles that can be reliably reproduced from source.

*.orig

Environment Secrets & Local Overrides

Local environment configurations, secrets, and credentials intended to protect developer-specific settings from exposure.

config/initializers/secret_token.rb.env.env*.local

Execution Caches & Runtime Logs

Diagnostic logs, runtime metadata, test coverage reports, and incremental compiler caches that cause noisy repository diffs.

/coverage//spec/tmp/tmp/*!/tmp/.keep/yarn-error.logyarn-debug.log*

Source & Verification

License: CC0-1.0

Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.