问题
Hi I am trying to set up the terminal shortcut for sublime text 2(subl
) but it's not working. I'm following the directions on https://github.com/mhartl/rails_tutorial_sublime_text/blob/master/README.md but can't get past the first step.
When I type:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
I receive the error
ln: /Users/edmundmai/bin/subl: No such file or directory
What should I do?
回答1:
This probably means that there is no ~/bin
directory. Which also probably means that it isn't in the PATH
. So just continue on to the next suggestion:
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
回答2:
Alternatively you can put it to your local bin:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
it may need creating the bin beforehand:
mkdir /usr/local/bin
回答3:
Another approach is define subl as your shell alias
http://opensourcehacker.com/2012/05/11/sublime-text-2-tips-for-python-and-web-developers/#Open_files_from_command-line
This is the recommended approach as it is against the best practices to add symlinks in /usr/bin
来源:https://stackoverflow.com/questions/12326098/sublime-text-subl-shortcut-not-working-ln-users-edmundmai-bin-subl-no-such-f