Creating new bash command for Sublime Text 2

I'm trying to get Sublime Text 2's command line alias working.

The instructions make perfect sense: Run

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

So, in ~/bin, subl exists. However, even when I restart terminal, the command 'subl' is not found. The path specified to the application's subl file is correct, I've verified that. Logging out does not fix it.

Any help would be awesome!


Solution 1:

Make sure ~/bin is added to your $PATH

Put this is your .bash_profile

PATH=$PATH:~/bin
export PATH

and it should be available next time you open a shell

Solution 2:

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

Solution 3:

if you are using RVM, do this:

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