Do you check in your rvmrc file?

Ruby Version Manager allows us to use an .rvmrc file in each project to set up which ruby version and gem set to load. Should this file be checked in to source control? Or does this presume too much about other developers’ working environment?

  • Git bash chcp windows7 encoding issue
  • Developing Ruby and Rails in Windows? Or Linux VM
  • env: node\r: No such file or directory with browserify-rails
  • Could not find rake-10.3.2 in any of the sources (Bundler::GemNotFound) on HTTPS push
  • Install RHC Client Tools (Openshift) on Windows 10
  • Trying to get svn2git working on Windows
  • GIT: Changed File Names With Certain Extension
  • How important is version control integration with your bug tracking software
  • Move bonobo git server repositories to another drive
  • Change Bindings on TFS project
  • Fix bad merge in mercurial
  • Cannot load Rails app fetched from GitHub; rake, rails server not working
  • 2 Solutions collect form web for “Do you check in your rvmrc file?”

    Source Control Management is mainly about reproducibility: are you able to reproduce a version of a development effort based on what you have stored in your SCM?

    If that .rvmrc file is needed for any developer on your project to be able to work (with the right artifacts), then yes, you should versioned it.

    As mentioned in RVM Best Practices:

    No. 2 – Check your rvmrc into source control.

    By checking the aforementioned rvmrc into source control along side your app, you’re ensuring all users have a consistent environment when they’re using rvm.

    By also automating gemset installs and the like (e.g. check out the rvmrc in the rvm-site repository or the TEDxPerth repostory’s rvmrc) you also make getting started as simple as changing directory.

    On top of this, you can also automatically make your deployments setup your application specific environment.

    Other developers can turn of use of gemsets on their RVM with:

    echo rvm_ignore_gemsets_flag=1 >> ~/.rvmrc
    

    This will make them use default gemset always.

    I would actually advise against keeping .rvmrc in SCM. Two specific reasons:

    1. If you use gemsets you enforce other developers to use the same gemset (while some might prefer to have all their gems in the global gemset).

    2. You make it hard for other developer(s) to run the project on a different Ruby version. Sure, on production it might run on 1.9.2-p290, but why should I not be permitted to run the app locally on 1.9.3-p0?

    Generally it enforces too much on each developer (same story as database.yml, which as well should not be kept in SCM). A note in the README of the project of the “production running” Ruby version is enough imo.

    Git Baby is a git and github fan, let's start git clone.