Sublime Text subl shortcut not working: ln: /Users/edmundmai/bin/subl: No such file or directory

我与影子孤独终老i 提交于 2020-08-21 01:42:42

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!