Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
311 views
in Technique[技术] by (71.8m points)

rvm - Should I check in `.ruby-gemset` and/or `.ruby-version`?

I've just updated RVM, and in place of the old .rvmrc, it auto-created .ruby-gemset and .ruby-version.

I've always had .rvmrc files with contents like rvm use --create default@project_name. However, .ruby-version contains the specific Ruby version I'm running rather than default. I'm hesitant to check this in.

Also, I heard someone say on a podcast that one shouldn't check in .ruby-gemset because others may have their own preferences about how to name gemsets.

When should or shouldn't I check in .ruby-gemset and/or .ruby-version?

Specifically:

  • What are some of the tradeoffs?
  • How does the type of project affect the decision (for example, applications vs gems)?
  • If they should be checked in, how does the type of project affect what should go in these files?

Citations from from the creators of tools like rvm, rbenv, etc would be appreciated in an answer.

question from:https://stackoverflow.com/questions/16087120/should-i-check-in-ruby-gemset-and-or-ruby-version

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For standard projects

Check in .ruby-version if your project depends on a ruby like ruby-2.0.0. Check in .ruby-gemset only if your team agreed on it. Add .rvmrc to .gitignore so anyone can override .ruby-* files settings with .rvmrc.

For gems

Check in .ruby-version with ruby-1.8.7 only if your project still targets ruby 1.8.7, otherwise check it in only if your gem requires it. Do not check in .ruby-gemset.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...