Home Download Buy Blog Forum Support

subl command not working…

subl command not working…

Postby oliveranimals on Sat Oct 26, 2013 4:51 pm

Going round in circles here. Trying to get the subl command working; but failing.

I entered the following:
Code: Select all
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl


Terminal spits out:
ln: /Users/oliver/bin/subl: File exists


I type:
Code: Select all
subl


Terminal spits out:
-bash: subl: command not found


Urgh!? What am I doing wrong?
oliveranimals
 
Posts: 2
Joined: Sat Oct 26, 2013 4:47 pm

Re: subl command not working…

Postby qgates on Sat Oct 26, 2013 5:10 pm

1. Check the symlink exists: assuming the switches are the same as linux, you can look with ls -l ~/bin
2. It exists, then Is the symlink executable?
3. If yes, try to run subl with a pathref: ~/bin/subl. No? chmod +x to make executable.
4. If it runs with pathref, is ~/bin in the path? probably is but I don't know with Macs (should be)
qgates
 
Posts: 205
Joined: Mon Nov 05, 2012 4:33 pm

Re: subl command not working…

Postby oliveranimals on Sat Oct 26, 2013 5:29 pm

Right. I've partly solved this. Thanks for the help.

I've got Sublime Text 3, not 2! (I'm an idiot.)

I've deleted the old symlink and made one for Sublime 3. The command works, but only with the pathref (ie ~/bin/subl).

I assume the OS isn't aware that it's there. Should I put the symlink somewhere else?
oliveranimals
 
Posts: 2
Joined: Sat Oct 26, 2013 4:47 pm

Re: subl command not working…

Postby qgates on Sun Oct 27, 2013 2:05 pm

Looks like osx doesn't have ~/bin in the path by default.

Easiest way is by adding to a .bashrc file. The following should help you:

http://stackoverflow.com/a/10768487
qgates
 
Posts: 205
Joined: Mon Nov 05, 2012 4:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 13 guests