须藤:端口:找不到命令 [英] sudo: port: command not found
问题描述
我最近卸载了 Xcode 4.2 并重新安装了 Xcode 4.3.1.命令行工具已安装.然后,我使用来自 macports.org 的 Lion 的dmg"磁盘映像安装了 MacPort.因为,每次使用端口后,我都会收到 sudo: port: command not found
,所以我遵循了 this 和 这篇文章 创建一个 .bash_profile
文件(之前不存在),然后将以下内容放入其中,但无济于事.
I recently uninstalled Xcode 4.2 and re-installed Xcode 4.3.1. Command Line Tools are installed. I then installed MacPort using "dmg" disk images for Lion from macports.org. Since, I was getting sudo: port: command not found
after every use of port, I followed this and this post to create a .bash_profile
file(wasn't present earlier) and then put in it the following but to no avail.
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
关注这篇文章
➜ ~ git:(master) ✗ rvm install 1.8.7 --with-openssl-dir=/opt/local
You requested building with '/usr/bin/gcc-4.2' but it is not in your path.
➜ ~ git:(master) ✗ vi .rvmrc
rvm_archflags="-arch x86_64"
export CC="/usr/bin/gcc-4.2"
export CFLAGS="-O2 -arch x86_64"
export LDFLAGS="-L/opt/local/lib"
export CPPFLAGS="-I/opt/local/include"
将 .bash_profile
重命名为 .profile
➜ ~ git:(master) ✗ vi .bash_profile
➜ ~ git:(master) ✗ mv .bash_profile .profile
➜ ~ git:(master) ✗ mv .profile
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
➜ ~ git:(master) ✗ mv -f .bash_profile .profile
mv: rename .bash_profile to .profile: No such file or directory
➜ ~ git:(master) ✗ port
zsh: correct 'port' to 'pr' [nyae]? n
zsh: command not found: port
➜ ~ git:(master) ✗ which port
port not found
➜ ~ git:(master) ✗
.profile
内容:
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
推荐答案
确保删除 ~/.bash_profile 和 ~/.bash_login 以便 .profile 可以工作.这对我有用 http://johnnywey.wordpress.com/2008/04/17/fixing-bash-profile-in-os-x/
Make sure to delete ~/.bash_profile and ~/.bash_login so that .profile can work. This worked for me http://johnnywey.wordpress.com/2008/04/17/fixing-bash-profile-in-os-x/
这篇关于须藤:端口:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!