新手问题 when l typed "rvm use ..." command in ubuntu terminal , it remains me ........

bbos1994 · 2015年08月15日 · 最后由 bbos1994 回复于 2015年08月25日 · 2688 次阅读

"Warning! PATH is not properly set up, '/home/ton/.rvm/gems/ruby-2.0.0-p643/bin' is not at first place, usually this is caused by shell initialization files - check them for 'PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-2.0.0-p643'. "

Even this warning , commnd is successful . But this made me feel confused and when l use this command first in a new terminal it appears again. According to these words , l need to set something like 'PATH' , l wonder if Ruby need to set enviroment path like Java ? Thanks advanced . (Both chinese and english are ok . )

Ruby doesn't need to set the ENV like Java did, but rvm needs. Since rvm manages multiple versions of ruby, it creates multiple shims for ruby binnary command, in order to find the proper one ( when you setup a specific version by using .vimrc file or use rvm use command directly), rvm needs a proper PATH setting, and rvm's path should be placed in the 1st position in PATH variable, otherwise maybe a wrong version of Ruby will be used.

To fix your problem, you need to be sure rvm is the last one to setup its path in the 1st position, so no other tools change this order during the initialization of shell. Typically, this happens because something else, such as node/go...etc, change the PATH variable after rvm does, you can check the PATH variable by echo $PATH and see the result to see if anything occures befor rvm's path

#1 楼 @nightire Thx so much , my problem are fixed by ur suggestion . l have already enjoyed building my blog with octopress . Have a nice day !

需要 登录 后方可回复, 如果你还没有账号请 注册新账号