【问题标题】:Sublime Text 2 does not work from the command line after installing OS X Mavericks安装 OS X Mavericks 后,Sublime Text 2 无法从命令行运行
【发布时间】:2014-03-06 23:40:53
【问题描述】:

安装 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

不确定是什么问题。

【问题讨论】:

    标签: sublimetext2 osx-mavericks


    【解决方案1】:

    我从 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"
    

    【讨论】:

      猜你喜欢
      • 2013-11-03
      • 1970-01-01
      • 2012-06-08
      • 2014-04-25
      • 1970-01-01
      • 2013-12-02
      • 2014-04-09
      • 2015-02-25
      相关资源
      最近更新 更多