1
welsonla 2013-08-07 17:03:32 +08:00
vim ~/.bash_profile
把你刚才echo进去的删掉 |
2
kaiwei OP @welsonla 你好,
Kaiweis-MacBook-Air:~ kaiweiwang$ vim ~/.bash_profile -bash: vim: command not found 貌似我没装vim? |
3
rwx 2013-08-07 17:07:03 +08:00
你不仅有终端,还有GUI
|
5
rwx 2013-08-07 17:15:40 +08:00
@kaiwei Mac不在手边没法测试,不过Open File不能直接输入路径么?确实没印象了。。
另外没装vim的话系统自带vi,不过你连ls都用不了的话就真别指望命令行了 |
6
Ansen 2013-08-07 17:17:36 +08:00
没用过mac
以下在centos适用 /bin/cp /etc/profile ~/.bash_profile 重启就行了 本来可以用 source ~/.bash_profile 不用重启的 但是找了半天没有找到source命令的绝对路径 |
7
cdfmr 2013-08-07 17:18:04 +08:00
终端下用export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin恢复PATH,然后vi .bash_profile修改。
|
8
kaiwei OP @cdfmr 你好!谢谢回复。按照你的建议先输入:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin 然后输入 vi .bash_profile 显示如下: export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH" export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH" [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function ## # Your previous /Users/kaiweiwang/.bash_profile file was backed up as /Users/kaiweiwang/.bash_profile.macports-saved_2013-08-06_at_19:04:22 ## # MacPorts Installer addition on 2013-08-06_at_19:04:22: adding an appropriate PATH variable for use with MacPorts. export PATH=/opt/local/bin:/opt/local/sbin:$PATH # Finished adapting your PATH environment variable for use with MacPorts. test -r /sw2/bin/init.sh && . /sw2/bin/init.sh test -r /sw/bin/init.sh && . /sw/bin/init.sh export PATH="HOME/.rbenv/bin:SPATH" eval "$(rbenv init -)" export PATH="HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:SPATH" export PATH="$HOME/.rbenv/bin:$PATH" export PATH="$HOME/.rbenv/bin:$PATH" ~ ~ ~ ~ ~ 然后就不动了。不知下步如何进行。多谢! |
10
kaiwei OP 貌似解决了。关掉terminal重启机器。但是这回terminal显示:
Last login: Wed Aug 7 10:45:29 on console -bash: rbenv: command not found dhcp-163-1-81-170:~ kaiweiwang$ 不管他,输入: PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin 之后貌似ls rm等命令就可以用了。 不明觉厉,或者瞎猫碰死耗子。。。 |