0
我使用Mac OS X,我有一些配置文件和bash_profile。這裏是我的文件的內容:
cat ~/.profile
PATH=/usr/local/git/bin:$PATH
export PATH
和
cat ~/.bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
export M2_HOME=/Users/myName/Tools/apache-maven-3.2.5
export GIT_HOME=/usr/local/git
export PATH=$PATH:$M2_HOME/bin:$GIT_HOME/bin
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
MYSQL=/usr/local/mysql/bin
export PATH=$PATH:$MYSQL
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
### ADDED FOR SUBLIME SYMLINK
export PATH=/usr/bin/local/bin:$PATH
這裏是$ PATH的內容:
echo $PATH
/usr/bin/local/bin:/Users/myname/.rbenv/shims:/Users/myname/.rbenv/shims:/usr/local/heroku/bin:/usr/local/git/bin:/usr/local/git/bin:/usr/local/git/bin:/Users/myname/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rspec-3.4.0/lib/rspec.rb:/usr/bin/local/bin:/Users/myname/.rbenv/shims:/Users/myname/.rbenv/shims:/usr/local/heroku/bin:/usr/local/git/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin:/Users/myname/Tools/apache-maven-3.2.5/bin:/usr/local/git/bin:/usr/local/mysql/bin:/Users/myname/Tools/apache-maven-3.2.5/bin:/usr/local/git/bin:/usr/local/mysql/bin
我不明白爲什麼我有這樣的/用戶/ myname/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rspec-3.4.0/lib/rspec.rb。我怎麼能刪除它?我在〜/ .profile和〜/ .bash_profile中都看不到它。
感謝您的幫助
「rbenv init」是否添加到路徑中? – hft
bash忽略.profile如果.bash_profile存在,那麼.profile是無關緊要的。但.bash_profile中的PATH添加似乎已經執行了兩次,還有一些其他添加(「/usr/local/git/bin:/usr/local/git/bin:/Users/myname/.rbenv/versions/2.2。 2/lib/ruby/gems/2.2.0/gems/rspec-3.4.0/lib/rspec.rb「)。這是從哪裏來的,我不確定。你有.bashrc文件嗎? –