0

我正在尝试将目录添加到我的路径中,但遇到了麻烦。我有一个Macbook Pro正在运行的Mac OS X Lion 10.7.5. 为了进行更改,我使用了以下命令:

open ~/.bash_profile

它打开了配置文件,它看起来像这样:

export PATH=${PATH}:/Users/Banderson/android-sdks/tools 
export PATH=${PATH}:/Users/Banderson/android-sdks/platform-tools 
#
# Your previous /Users/Banderson/.bash_profile file was backed up as /Users/Banderson/.bash_profile.macports-saved_2012-05-16_at_09:53:57
##

# MacPorts Installer addition on 2012-05-16_at_09:53:57: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

# Setting PATH for JRuby 1.7.0.RC1
# The orginal version is saved in .bash_profile.jrubysave
PATH="${PATH}:/Library/Frameworks/JRuby.framework/Versions/Current/bin"
export PATH

然后我添加了这个:

   export PATH=${PATH}:/Users/Banderson/Documents/awstats-7.1/wwwroot/cgi-bin/

使.bash_profile看起来像这样:

export PATH=${PATH}:/Users/Banderson/android-sdks/tools 
export PATH=${PATH}:/Users/Banderson/android-sdks/platform-tools 
export PATH=${PATH}:/Users/Banderson/Documents/awstats-7.1/wwwroot/cgi-bin/
#
# Your previous /Users/Banderson/.bash_profile file was backed up as /Users/Banderson/.bash_profile.macports-saved_2012-05-16_at_09:53:57
##

# MacPorts Installer addition on 2012-05-16_at_09:53:57: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

# Setting PATH for JRuby 1.7.0.RC1
# The orginal version is saved in .bash_profile.jrubysave
PATH="${PATH}:/Library/Frameworks/JRuby.framework/Versions/Current/bin"
export PATH

添加之后,我保存它,然后在终端中,我执行source ~/.bash_profile命令,退出终端窗口,启动一个新窗口,并尝试从我添加到路径的目录中启动一个文件,但它没有工作. 有人可以告诉我我做错了什么以及如何解决吗?

编辑:

这是echo $PATH返回的内容:

/Users/Banderson/.rvm/gems/jruby-1.6.8/bin:/Users/Banderson/.rvm/gems/jruby-1.6.8@global/bin:/Users/Banderson/.rvm/rubies/jruby-1.6.8/bin:/Users/Banderson/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/Banderson/android-sdks/tools:/Users/Banderson/android-sdks/platform-tools:/Users/Banderson/Documents/awstats-7.1/wwwroot/cgi-bin/:/Library/Frameworks/JRuby.framework/Versions/Current/bin
4

1 回答 1

0

您的问题似乎是包含 rvm 脚本。我猜,你的路径被覆盖了。

于 2012-12-23T07:39:16.170 回答