I cannot get rvm to read my project specific .rvmrc

时光毁灭记忆、已成空白 提交于 2019-12-21 11:32:31

问题


I come in peace (re: rbenv) but I am super frustrated with rvm & .rvmrc. I keep on running into issues where I cd into my project folder only to find that my ruby & gemset environment has not been set correctly. So can someone once and for all tell me how to create a proper .rvmrc for my project.

I have tried both ways that I know of:

  1. creating a .rvmrc and putting 'rvm use 1.9.2@GEMSET' in there (this works sometimes and sometimes not)
  2. using the rvm --create --rvmrc 1.9.2@GEMSET command line tool which creates a more ellaborate .rvmrc but cd'ing into my project folder is still not giving me the desired result.

This problem is erratic. I will say that I am working on two different machines and syncing my project folder via Dropbox. So could this be a problem where rvm cannot verify the folder and therefore ignores the .rvmrc?

Any help will be greatly appreciated.


回答1:


You may need to set

rvm_project_rvmrc=1

in your shell config before the rvm scripts are sourced, e.g.:

rvm_project_rvmrc=1
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"



回答2:


Every time you enter a project directory after changing its .rvmrc file, rvm will prompt you for accepting or not the new file. If you want to change your decision afterwards, you should use rvm rvmrc command:

rvm rvmrc {trust,untrust,trusted,load,reset}


来源:https://stackoverflow.com/questions/7180102/i-cannot-get-rvm-to-read-my-project-specific-rvmrc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!