安装OS X Mavericks之后,我注意到我无法再通过输入'subl'从命令行启动Sublime Text 2。我在线查看了Sublime Text文档和Stack Overflow,并在此处创建了一个符号链接:
Christophers-MacBook-Pro-2:bin christopherspears$ pwd
/usr/local/bin
Christophers-MacBook-Pro-2:bin christopherspears$ ll
lrwxr-xr-x 1 christopherspears staff 62 Mar 6 15:24 subl@ -> /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
然后我查看了我的.bash_profile文件:
Christophers-MacBook-Pro-2:~ christopherspears$ cat .bash_profile
export PATH="/usr/local/bin:$PATH"
# Set your default text editor
export EDITOR=subl
似乎/ usr / local / bin在$ PATH中:
Christophers-MacBook-Pro-2:~ christopherspears$ echo $PATH
/usr/local/share/python:/Users/christopherspears/.rbenv/bin:/usr/local/heroku/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
不确定是什么问题。
答案 0 :(得分:0)
我从Mac OS X卸载了Sublime Text 2并安装了Sublime Text 3(只是想查看测试版)。然后我在我的主目录(/ Users / christopherspears / bin)中创建了一个链接:
Christophers-MacBook-Pro-2:bin christopherspears$ la
total 8
drwxr-xr-x 3 christopherspears staff 102 Mar 7 18:41 ./
drwxr-xr-x+ 57 christopherspears staff 1938 Mar 7 19:00 ../
lrwxr-xr-x 1 christopherspears staff 62 Mar 7 18:41 subl@ -> /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
我必须自己创建'bin'目录。在我的.bash_profile中添加了以下内容:
# Set your default text editor
export EDITOR='subl -w'
export PATH="$HOME/bin:$PATH"