Use rvmrc or ruby-version file to set a project gemset with RVM?

后端 未结 5 1968
有刺的猬
有刺的猬 2020-11-29 15:03

I use RVM, the Ruby Version Manager to specify a Ruby version and a set of gems for each of my Rails projects.

I have a .rvmrc file to automatically sel

5条回答
  •  臣服心动
    2020-11-29 15:09

    You can try both. Go to the root of your project, create a .rvmrc file (touch .rvmrc), then edit rvm use 2.0.0-p451@your_gemset (your ruby version and gemset name). After save this file, you can type this command:

    cd ../your_project (you're in your_project directory), and the script in .rvmrc will execute.

    The RVM recommend to use ruby-version. You can run this command to switch from .rvmrc to .ruby-version

    rvm rvmrc to .ruby-version

    What it does is create 2 files name .ruby-version, and .ruby-gemset and add this line

    ruby-2.0.0-p451 in .ruby-version

    your_gemset in .ruby-gemset

    You can try to do it manually if you want :)

提交回复
热议问题