用自制安装Ruby [英] Installing Ruby with Homebrew

查看:216
本文介绍了用自制安装Ruby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我家酿安装了Ruby:

I installed Ruby with Homebrew:

brew install ruby

在注意事项它说:

Under "Caveats" it said:

请注意:默认情况下,创业板安装的二进制文件将被放置到:结果
  /usr/local/Cellar/ruby/1.9.3-p194/bin

NOTE: By default, gem installed binaries will be placed into:
/usr/local/Cellar/ruby/1.9.3-p194/bin

您可能想要将它添加到您的PATH。

You may want to add this to your PATH.

这是什么意思,我怎么可以把它添加到我的路径?假设它有一个.bash_profile中,但新的这个做的。

What does that mean and how can I add it to my "path"? Assuming it has to do with a bash_profile but new to this.

推荐答案

〜/ .bash_profile中添加以下行

export PATH=/usr/local/Cellar/ruby/1.9.3-p194/bin:$PATH

当您完成后,关闭终端并重新打开它。你应该罚款。

When you're done, close your terminal and re-open it. You should be fine.

另外,您也可以执行在每个开壳,而不是关闭/重新开放的follwing:

Alternatively, you can execute the follwing in each open shell instead of closing/re-opening:

source ~/.bash_profile

注意:
我强烈建议通过 RVM rbenv 安装Ruby这样你就可以管理多个Ruby版本和使用gemsets。

Note: I highly recommend installing ruby via rvm or rbenv so you can manage multiple ruby versions and use gemsets.

这篇关于用自制安装Ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆