terminal - 须藤 : port: command not found

标签 terminal osx-lion macports xcode4.3 bash

我最近卸载了 Xcode 4.2 并重新安装了 Xcode 4.3.1。命令行工具已安装。然后,我使用来自 macports.org 的 Lion 的“dmg”磁盘镜像安装了 MacPort。因为,每次使用端口后我都得到 sudo: port: command not found,所以我遵循了 thisthis post创建一个 .bash_profile 文件(之前不存在),然后将以下内容放入其中但无济于事。

export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info 

正在关注 this post

➜  ~ 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

最佳答案

首先,您可能需要编辑系统的 PATH

sudo vi /etc/paths

添加以下两行:

/opt/local/bin
/opt/local/sbin

重启终端

关于terminal - 须藤 : port: command not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9694395/

相关文章:

react-native - React Native 中的 Chalk 没有样式

macos - 是否可以像IPC一样使用Mac OS X XPC在进程之间交换消息?如何?

cocoa - 如何实现狮子风格的滑动和滑走动画

ruby - 使用 Xcode 4.3.1 在 Mac 上更新 Ruby 时出现问题

macos - 调用macports svn而不是预装mac的svn

Macport 上的 Ch 或 CINT?

linux - 在 bash 脚本上做完整的工作流

java - 通过终端执行java实例方法

java - 如何: output utf-8(kannada) characters in windows terminal using java

c++ - Xcode (4.3.2) 与从端口安装的 openCV (2.3.1) 出现问题