Sublime Forum

Subl command not working…

#1

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

I entered the following:

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

Terminal spits out:

I type:

subl

Terminal spits out:

[quote]-bash: subl: command not found
[/quote]

Urgh!? What am I doing wrong?

0 Likes

#2
  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)
0 Likes

#3

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?

0 Likes

#4

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:

stackoverflow.com/a/10768487

0 Likes