我最近卸载了Xcode 4.2并重新安装了Xcode 4.3.1。已安装命令行工具。然后,我使用来自macports.org的Lion“dmg”磁盘映像安装了MacPort。由于每次使用端口后都会收到“sudo:port:command not found”的提示,所以我按照此文和此贴创建了一个.bash_profile
文件(之前不存在),并将以下内容放入其中,但没有成功。
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