"subl ." 命令找不到的问题

Sometimes,if you want to use one editor,for example:Sublime text 2 or textmate,etc.you will hope you can use them in the terminal via use the short cmd.but maybe you will caught the command can not found error. html

Now I record the way I am fix the issue that 'subl .' can not be found. shell

http://www.sublimetext.com/docs/2/osx_command_line.html ruby

https://teamtreehouse.com/forum/ruby-on-rails-subl-command-not-found bash

If you read these two passages,you can fix it. app

Update: less

Today I try the way above, but can not fix the issue, at last I have used cmd: ruby-on-rails

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl
use sudo to do it, the issue fixed.

Reference Link: spa

http://www.kadrmasconcepts.com/blog/2012/02/08/sublime-from-the-command-line/ code

更新: htm

若是是新的Mac OS X,大概在10.11.3的话,以前的方式是会失败的,因为新系统有Rootless机制,致使/usr/bin 这个目录根本不可写入,能够把这个放到另外的目录连接中,如: ```/usr/local/bin/subl```,能够经过```echo $PATH``` 知道有哪学目录是能够的。

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Thanks,

Blues

相关文章
相关标签/搜索