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/subluse 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