rbenv 和 MacPorts 的路径位置

发布于 2024-12-20 05:29:02 字数 793 浏览 2 评论 0原文

我已经使用 python 几个月了我有 python 和通过 bash_login 中的 MacPorts 在 Mac 上安装 git @ export PATH="opt/local/bin:/opt/local/bin/mysql5/bin:/opt/local/ lib/postgresql90/bin:/usr/local/bin:/usr/local/sbin:$PATH"

今天我想尝试 ruby​​ 所以我安装了 Rbenv & ruby 1.9.2-p290 通过 ruby​​-build。它在 bash_profile @ PATH="$HOME/.rbenv/bin:$PATH" 中创建了一个路径 eval "$(rbenv init -)"

当我在终端中 echo $PATH 时,我的路径现在设置为:/Users/demet8/.rbenv/shims:/Users/demet8/.rbenv/bin:/usr/bin:/ bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

我无法再使用我的 python/git/ 因为我的系统首先读取 Usr/local/ bash_profile(文件)。

问题:我需要先阅读 opt/local/ ,这样我仍然可以使用 python/git 。我应该消除创建的 bash_profile (文件)rbenv 吗?将 rbenv 的路径合并到我的 bash_login 路径中?

I have been using python for months & I have python & git installed on a Mac via MacPorts in bash_login @ export PATH="opt/local/bin:/opt/local/bin/mysql5/bin:/opt/local/lib/postgresql90/bin:/usr/local/bin:/usr/local/sbin:$PATH"

Today I wanted to try ruby so I installed Rbenv & ruby 1.9.2-p290 via ruby-build. It created a path in bash_profile @ PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

When I echo $PATH in the terminal my path is now set to:/Users/demet8/.rbenv/shims:/Users/demet8/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

I am no longer able to use my python/git/ because my system is reading Usr/local/ first in the bash_profile (file).

Question: I need opt/local/ to read first so I can still use python/git. Should I eliminate the bash_profile (file) rbenv created & consolidate rbenv's path into my bash_login path?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡の花香 2024-12-27 05:29:02

您应该合并 bash_profile 文件中的所有路径。 macports 路径和 rbenv 是不同的,可以放在一起而不会有顺序冲突。

我同时使用 Macports、Python 和 Rbenv &红宝石。

我的综合路径如下所示:

/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin:
/Users/user1/.rvm/gems/ruby-1.9.2-p290@global/bin:
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/bin:
/Users/user1/.rvm/bin:/opt/local/bin:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
....

您可以这样:

PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

You should consolidate all paths in your bash_profile file. The macports path and rbenv are distinct and can be pulled together without conflict of order.

I use both Macports, Python and Rbenv & Ruby.

My consolidated path looks like this:

/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin:
/Users/user1/.rvm/gems/ruby-1.9.2-p290@global/bin:
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/bin:
/Users/user1/.rvm/bin:/opt/local/bin:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
....

You could have it like this:

PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文