Rails 用 RVM 安装了 rails,但为什么每次重开 iTerm 后输入 rails -v,总是提示我需要重新 gem install rails?

shoto · 2015年04月02日 · 最后由 chinacheng 回复于 2015年04月02日 · 2067 次阅读

新手,完全不知道哪里配置不对。按照教程http://railsapps.github.io/installrubyonrails-mac.html一步一步安装的。

但每次重新打开 iterm 再次时,就提示 rails 没有安装。要求重新安装。

➜  ~  rails -v
Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

用 ctrl + alt + t 打开终端试试?

rvm use 2.2.1 --default

如果还不行,就是要看一下 path 加载,有没有加载 rvm 了

$ echo "ruby-2.2.0" > .ruby-version $ echo "myapp" > .ruby-gemset 完成了这两步以后正常了。

@shoto 可能是你对文章上的内容理解不到位,试试看根据这里的介绍一步一步安装看看 https://gorails.com/setup/osx/10.10-yosemite

这个你打开 iterm 时对应的 rvm 环境变量没有加载

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