github/gitignore · Ruby.gitignore

Ruby .gitignore 템플릿 해설

Ruby.gitignore가 gem 패키지, Bundler 설치 폴더, 테스트 결과, 문서 생성물을 무시하는 이유와 Gemfile.lock·.ruby-version 커밋 기준을 설명합니다.

생성기에서 열기 Rails, macOS, JetBrains 함께 열기

Ruby.gitignore는 gem을 만들거나 Ruby 스크립트·애플리케이션을 개발하는 프로젝트용이다. 대부분의 규칙이 /로 시작해 저장소 루트에 고정되어 있어, 같은 이름의 하위 폴더를 실수로 무시하는 일이 적다.

Rails 애플리케이션이라면 이 템플릿보다 Rails 템플릿이 더 많은 경우를 다룬다. 둘을 함께 선택하면 겹치는 규칙은 중복 제거로 정리된다.

규칙별 해설

패턴무엇을, 왜 무시하나
*.gem/pkg/gem 패키지gem buildrake build가 만드는 패키지 파일이다. RubyGems에 게시하는 산출물이다.
/.bundle//vendor/bundle/lib/bundler/man/Bundler.bundle/에는 로컬 Bundler 설정이, vendor/bundle에는 bundle install --path로 설치한 gem이 들어간다. 다른 컴퓨터에서 다시 설치할 수 있다.
/coverage//spec/reports//spec/examples.txt/test/tmp//test/version_tmp/테스트 결과SimpleCov 결과, RSpec 리포트, RSpec이 실패한 예제를 기억하는 examples.txt 같은 실행 결과다.
/.yardoc//_yardoc//doc//rdoc/문서 생성물YARD·RDoc이 만든 API 문서와 캐시다. 소스 주석에서 다시 만든다.
/tmp/.byebug_history.repl_history*.rbc/.config/InstalledFiles임시·디버거 파일임시 폴더, byebug·REPL 기록, Rubinius 바이트코드, setup.rb 설치 기록이다.
.rvmrc버전 관리자 설정RVM의 옛 프로젝트 설정 파일로, 셸 코드를 실행할 수 있어 공유를 피한다. 요즘은 .ruby-version을 주로 쓴다.

실무에서 주의할 점

원본 템플릿

Ruby.gitignore규칙 26줄
*.gem*.rbc/.config/coverage//InstalledFiles/pkg//spec/reports//spec/examples.txt/test/tmp//test/version_tmp//tmp/# Used by dotenv library to load environment variables.# .env# Ignore Byebug command history file..byebug_history## Specific to RubyMotion:.dat*.repl_historybuild/*.bridgesupportbuild-iPhoneOS/build-iPhoneSimulator/## Specific to RubyMotion (use of CocoaPods):## We recommend against adding the Pods directory to your .gitignore. However# you should judge for yourself, the pros and cons are mentioned at:# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control## vendor/Pods/## Documentation cache and generated files:/.yardoc//_yardoc//doc//rdoc/## Environment normalization:/.bundle//vendor/bundle/lib/bundler/man/# for a library or gem, you might want to ignore these files since the code is# intended to run in multiple environments; otherwise, check them in:# Gemfile.lock# .ruby-version# .ruby-gemset# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:.rvmrc# Used by RuboCop. Remote config files pulled in from inherit_from directive.# .rubocop-https?--*

템플릿 출처: github/gitignore/Ruby.gitignore @356fd7b (2026-09-11) · CC0-1.0

함께 쓰는 템플릿

다른 템플릿 해설