【发布时间】:2012-03-30 11:10:22
【问题描述】:
我最近卸载了 Xcode 4.2 并重新安装了 Xcode 4.3.1。命令行工具已安装。然后,我使用来自 macports.org 的 Lion 的“dmg”磁盘映像安装了 MacPort。因为,每次使用端口后我都会收到sudo: port: command not found,我跟着this 和this post 创建了一个.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
【问题讨论】:
-
我在为 Rails 应用程序安装 MongoDB 时在命令行中遇到了这个错误,所以我想其他人也可能通过谷歌搜索使用相同的关键字找到这个问题。我所做的只是更新 XCode 并从 macports.org 安装 MacPorts,在此页面上执行任何其他操作之前尝试一下。
标签: terminal osx-lion macports xcode4.3 .bash-profile