更改文件夹rvm时未选择正确的红宝石和gemset版本

问题描述

我从事多个Rails项目,每次切换到一些Rails应用程序时,我都需要设置ruby和gemset版本。我尝试将其设置为默认设置,但不适用于其他项目。我还阅读了answer,它建议创建以下文件,但是没有运气。

.ruby-version
.ruby-gemset

此外,每当我再次在终端中切换到新选项卡时,都需要设置ruby和gemset版本。我不确定如何解决它,任何建议都会有帮助

anikettiwari@12345:~/my_folder/project$ rvm list
Warning! PATH is not properly set up,/home/anikettiwari/.rvm/gems/ruby-2.5.3/bin is not at first place.
         Usually this is caused by shell initialization files. Search for PATH=... entries.
         You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
         To fix it temporarily in this shell session run: rvm use ruby-2.5.3
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
=* ruby-2.5.3 [ x86_64 ]
   ruby-2.6.5 [ x86_64 ]
   ruby-2.7.1 [ x86_64 ]


anikettiwari@12345:~/my_folder/discourse$ rvm gemset list
Warning! PATH is not properly set up,/home/anikettiwari/.rvm/gems/ruby-2.5.3/bin is not at first place.
         Usually this is caused by shell initialization files. Search for PATH=... entries.
         You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
         To fix it temporarily in this shell session run: rvm use ruby-2.5.3
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

gemsets for ruby-2.5.3 (found in /home/anikettiwari/.rvm/gems/ruby-2.5.3)
=> (default)
   discourse_project
   global
   rails5-portal

解决方法

在 bashrc 文件末尾添加 cd . 后,它起作用了。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...