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
Andrew Chappell12,782 Points
Cannot open Sublime Text 3 from Terminal like in Laravel Basics Course.
I'm following along with the Laravel install and tried the command
sudo subl hosts from my home directory. This just returns
sudo: subl: command not found.
I looked at this documentation from Sublime http://www.sublimetext.com/docs/3/osx_command_line.html and after pasting in their suggested code:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
I get the following
/Users/Chappell/bin/subl: No such file or directory
As far as I can see there is no file called subl in the bin directory.
To set the environment variable, see the bottom of the page at the link you posted, under the heading EDITOR:
export EDITOR='subl -w'
Then, to apply the change, try:
Restart your terminal program, then try the
subl . command (that's "subl space period") in a directory you want to open in Sublime. I think this will work; there are a lot of variables, but that's the "simplest" version I know of. Worked for me.
Candice Eisner10,514 Points
If things still aren't working after following James' instructions, try this suggestion from Stack Overflow, which sets the symlink to be in /usr/bin/subl instead of ~/bin/subl:
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl
Andrew, did you set the environment variable? And afterward, did you use the
source command to apply changes?