cannot get sublime text 3 command line tools to work

梦想的初衷 提交于 2019-12-12 18:24:53

问题


I had sublime text 2 command line tools working. When I downloaded Sublime Text 3, I could not get the command line tools to work. I've tried every answer here: Open Sublime Text from Terminal in macOS. When I type:

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

I get back:

ln: /usr/local/bin/subl: File exists

but no matter what I do I still get back -bash: subl: command not found


回答1:


Remove the existing link first. It must be a broken link.

List the contents of the directory and you'll see that the link is broken:

$ ls -Al /usr/local/bin/

Output from the above command will show that the existing link is pointing to a non existing file. So delete the broken link:

$ rm /usr/local/bin/subl

You might need to use sudo for the above command.

Now you can create the symlink:

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



回答2:


I had the same issue and nothing seemed to work. Also, if you have Sublime 2, remember to use:

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

I was not getting it right at first because I forgot the version!



来源:https://stackoverflow.com/questions/39854720/cannot-get-sublime-text-3-command-line-tools-to-work

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