安装时出现 RVM 警告?

RVM warning on install?

我一直在我的 macOSX 10.14.6 上使用自制程序和 chruby 全局使用 ruby,这在不同的应用程序和 gem 更新时引起了问题。一位朋友向我推荐了 RVM,这样我就可以隔离我的项目。

有人介意解释一下这个警告是否需要修复吗?我不完全了解为什么或如何?

我用 \curl -sSL https://get.rvm.io | bash -s stable 安装了 RVM,并在我的 bash_profile

中添加了“source ~/.rvm/scripts/rvm

然后运行rvm install 2.5.1

我在我的日志中得到了这个:

Warning! PATH is not properly set up, /Users/MYNAME/.gem/ruby/2.5.1/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 2.5.1
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.14/x86_64/ruby-2.5.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

有人介意解释一下这个警告是否需要修复吗?我不完全了解为什么或如何?

感谢您的帮助

你需要执行

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

你不需要再做一次。该行将必要的文件包含信息 RVM 附加到您的 .bash_profile。如果您正在使用 bash(与 zsh、ksh、csh、tcsh 或任何其他 shell 相对),则每次打开新会话时都可以访问 RVM。如果您使用不同的 shell,该行可能需要位于不同的启动文件中。例如,如果您使用的是 zsh,那么您可能希望将其附加到您的 ~/.zshrc 文件中。

完成此操作后,只需 运行 rvm --default use 2.5.1 一次即可确保默认情况下您拥有所需的 Ruby 版本。请注意,您不需要将此行添加到您的 .bash_profile 或类似的。