更改文件夹时 rvm 没有选择正确的 ruby 和 gemset 版本

When changing folder rvm doesn't pick the correct ruby and gemset version

我从事多个 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 . 后,它起作用了。