Subl command not working - command not found

2019-03-08 04:04发布

Having loads of difficulty getting this set up. I've fixed up my .bash_profile, created the symlink using the following command from the sublime website:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl 

Yet when I input that command I get:

ln: /Users/my_username/bin/subl: No such file or directory

It appears my terminal is looking at the wrong place for the file? Why is it trying to point to a bin folder on my home directory?

9条回答
祖国的老花朵
2楼-- · 2019-03-08 04:28

My similar problem was solved simply by omitting the quotes. So if you're working with:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

I instead did:

ln -s /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl ~/bin/subl

查看更多
聊天终结者
3楼-- · 2019-03-08 04:35

if you are using "Sublime Text 2" try this:

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

or, if you path is in /usr/bin/ instead /usr/local/bin

$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
查看更多
来,给爷笑一个
4楼-- · 2019-03-08 04:35

At my end subl was working fine but git was unable to access it. And was displaying these errors

subl -n -w: subl: command not found
error: There was a problem with the editor 'subl -n -w'.

For Mac OS X in the file ~/.gitconfig under [core] I had to put this code to solve the issue on my end.

editor = /Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl  -n -w
查看更多
登录 后发表回答