Ava*_*Ava 60 terminal macports .bash-profile osx-lion xcode4.3
我最近卸载了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
Run Code Online (Sandbox Code Playgroud)
关注这篇文章
? ~ 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"
Run Code Online (Sandbox Code Playgroud)
重命名.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) ?
Run Code Online (Sandbox Code Playgroud)
.profile 内容:
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
Run Code Online (Sandbox Code Playgroud)
Isi*_*sis 127
首先,您可能需要编辑系统的PATH
sudo vi /etc/paths
Run Code Online (Sandbox Code Playgroud)
添加以下两行:
/opt/local/bin
/opt/local/sbin
Run Code Online (Sandbox Code Playgroud)
重新启动终端
小智 20
确保删除〜/ .bash_profile和〜/ .bash_login,以便.profile可以工作.这对我有用http://johnnywey.wordpress.com/2008/04/17/fixing-bash-profile-in-os-x/
Awa*_*ias 18
您可以尝试获取配置文件以更新您的环境:
$ source ~/.profile
Run Code Online (Sandbox Code Playgroud)
Nun*_*sta 16
我在官方网站上找到了答案
$ vi ~/.profile
# add the following line
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Run Code Online (Sandbox Code Playgroud)
现在重启终端或输入source !$(相当于source ~/.profile)
小智 15
如果你使用zsh.please将流动的字符串添加到文件'〜/ .zshrc'中的'export PATH ="..."'行
:/opt/local/bin:/opt/local/sbin
Run Code Online (Sandbox Code Playgroud)