Philip7899
Philip7899

Reputation: 4687

cannot get sublime text 3 command line tools to work

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

Upvotes: 2

Views: 569

Answers (2)

Thais
Thais

Reputation: 1

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!

Upvotes: 0

Gerard Roche
Gerard Roche

Reputation: 6411

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

Upvotes: 6

Related Questions