不,你不应该这样做(正如jthill所说),因为那是一个从源代码构建/生成的文件。补充jthill的评论,你可以在 "Supercharge your VIM into IDE with CTags" 中找到一个完整的配置示例。ctags 生成标签(所有类的索引文件)。ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths) 但是.gitignore总是会忽略那些生成的标签。由于您不想将这些文件提交到GIT索引中,请将它们添加到.gitignore中,或者我喜欢将它们添加到我的全局~/.gitignore中。$ cat <<EOT >> ~/.gitignore tags gems.tags EOT 查看 github/gitignore/Global/Tags.gitignore。