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!

link|improve this question
1  
Have you added ~/bin/subl to your $PATH? – Nifle Oct 26 '11 at 15:52
Sure haven't, I'm checking how to do this (first time for everything), but I'll gladly accept it in answer format! – Gavin Oct 26 '11 at 15:55
@Gavin Do you have both .bash_profile and .bashrc or only the former? Are there other occurrences of PATH in either of these files (or wherever that ruby stuff is set)? Does ~/bin/subl have the executable flag set? – Daniel Beck Oct 26 '11 at 16:42
feedback

1 Answer

up vote 5 down vote accepted

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

link|improve this answer
I just tried this to no avail - new shell session too. Is there anything obvious I could be missing? – Gavin Oct 26 '11 at 16:28
Potentially helpful.. when I run echo $PATH: '/Users/gavin/.rvm/gems/ruby-1.9.2-p290/bin:/Users/gavin/.rvm/gems/ruby-1.9.2-p2‌​90@global/bin:/Users/gavin/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/gavin/.rvm/bin:‌​/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin' – Gavin Oct 26 '11 at 16:34
1  
@Gavin - One problem is that the path should only be ~/bin, my bad. If it still doesn't work try using the full path /Users/gavin/bin – Nifle Oct 26 '11 at 16:48
@Gavin - Another thing occurred to me. I'm not sure OSX uses .bash_profile by default. You could put the lines in your .bashrc instead. – Nifle Oct 26 '11 at 16:50
Ah, that was it - just /bin. I see you've made that edit, so that's absolutely right. Cheers! – Gavin Oct 26 '11 at 17:12
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.