sudo:端口:找不到命令 [英] sudo: port: command not found

查看:143
本文介绍了sudo:端口:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近卸载了Xcode 4.2,然后重新安装了Xcode 4.3.1.已安装命令行工具.然后,我使用来自macports.org的Lion的"dmg"磁盘映像安装了MacPort.由于每次使用端口后都会得到sudo: port: command not found,所以我遵循此帖子到创建一个.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/

这篇关于sudo:端口:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆