Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Nthulane Makgato
PLUS
Nthulane Makgato
Courses Plus Student 19,602 Points

Can't launch sublime in command terminal

Hi Guys,

I would like to launch sublime text 2 in my terminal. I have run the following command to "sync" them, i found it on Github:

$ ln -s "/Applications/Sublime Text     2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
ln: /Users/nthulanemakgato/bin/subl: File exists

This is what happens when I try to launch the text editor.

$ subl
-bash: subl: command not found

I'm using Mac 10.9.2

Why is this the case and how can I fix it?

Thank you in advance.

4 Answers

Run this command:

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

I'm not sure why subl doesn't work but sublime should work.

You might also check out Atom.

Nthulane Makgato
PLUS
Nthulane Makgato
Courses Plus Student 19,602 Points

Thanks Dustin, however, there is another way to this. Your line of code needs to be typed in the terminal in order to open sublime text. Instead, i'm looking for something that will synchronise sublime text with terminal so that when I type subl or subl status.rb then sublime text opens with the relevant code.

Do you understand me? Any ideas on how I can do this?

Here you go:

$ open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

No problem. Glad you got it working. :-)