Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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. :-)