You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac High Sierra 10.13安装Ruby on Rails时提示‘-bash: rvm: command not found’

Fixing "rvm: command not found" After Installing RVM on Mac High Sierra v10.13

Hey there, I’ve dealt with this exact issue plenty of times when setting up Ruby on Rails on older macOS versions. Let’s walk through getting RVM working properly:

First, Verify RVM is Actually Installed

Before we tweak shell settings, let’s confirm RVM was installed successfully. Run this command in your terminal:

ls ~/.rvm

If you see folders like bin, scripts, and rubies, that means RVM is on your system—it just isn’t being loaded by your shell yet.

Load RVM Into Your Bash Shell

Mac High Sierra uses bash by default, so we need to add RVM’s initialization code to your shell’s config file. Here’s how:

  1. Open your bash profile in a text editor (nano is simple for terminal newbies):
nano ~/.bash_profile
  1. Paste these two lines at the bottom of the file:
export PATH="$PATH:$HOME/.rvm/bin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
  1. Save the file by pressing Ctrl + O, then hit Enter to confirm the filename. Exit nano with Ctrl + X.

  2. Make the changes take effect immediately without restarting your terminal:

source ~/.bash_profile

Test It Out

Now run the check command again:

rvm | head -n 1

You should see output like rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin (version number might vary).

If It Still Doesn’t Work

  • Try closing and reopening your terminal (or iTerm, if you use that)—sometimes shell sessions hold onto old configs.
  • If you accidentally use a different shell (like zsh), you’ll need to add those same lines to ~/.zshrc instead.
  • If the ls ~/.rvm command showed nothing, your initial RVM install probably failed. Re-run the install command and watch for error messages:
\curl -L https://get.rvm.io | bash -s stable

内容的提问来源于stack exchange,提问作者Leo Tyndall

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:31:39