Home Download Buy Blog Forum Support

subl command not recognized in command prompt

subl command not recognized in command prompt

Postby Newbie007 on Sat Mar 24, 2012 5:52 am

I'm brand new to Ruby and Rails, so sorry if this is a totally ridiculous question. The tutorial book that I'm reading says that I should be able to launch a Gemfile in Sublime Text directly from the command prompt using the subl Gemfile command. When I try this, I get an error that says "subl is not recognized as an internal or external command, operable program, or batch file".

I am in the right directory where the Gemfile is located.
Ruby is definitely installed and I am using the command prompt with Ruby and Rails.
Some searches online that I looked through mentioned something about having to add Sublime to the path...not sure if this would help or how to do this.
I initially had Vim as a text editor, and it would launch by itself from the command prompt. I uninstalled Vim after finding Sublime, so that may have something to do with the problem.

I can always go to Sublime Text manually and open the Gemfile, but I hate not understanding why something isn't working as expected. Any advice would be really appreciated.
Newbie007
 
Posts: 2
Joined: Sat Mar 24, 2012 5:38 am

Re: subl command not recognized in command prompt

Postby rockxwl on Sat Mar 24, 2012 4:20 pm

Hey, I'm a beginner with Rails (and programming) too and had this same issue which I have now resolved. There's 2 things I had to do.
Note: Windows 7 64 bit, Sublime Text 2 beta.

1. Add the Sublime directory to the windows PATH
2. I think 'subl' is a Mac-only command. For Windows it's 'sublime_text'

To add Sublime to the PATH:
1. Right click Computer -> Properties -> Advanced System Settings -> Environment Variable
2. Under 'System Variables' select variable: Path and hit 'Edit'.
3. At the end of the 'Variable value' text field, add a semicolon and enter the Sublime Text directory (for me it was 'C:\Sublime Text 2\' but the default is C:\Program Files\Sublime Text 2\)
4. OK, OK, OK

Then, in the prompt go to the appropriate directory and try 'sublime_text .'
rockxwl
 
Posts: 1
Joined: Sat Mar 24, 2012 4:11 pm

Re: subl command not recognized in command prompt

Postby Newbie007 on Tue Mar 27, 2012 2:18 am

Thanks @rockxwl...I gave it a shot but it's a no go. It might be a Win Vista thing (I don't think so). Maybe I should try Sublime Text 2.
Newbie007
 
Posts: 2
Joined: Sat Mar 24, 2012 5:38 am

Re: subl command not recognized in command prompt

Postby sunu0000 on Sun Apr 08, 2012 1:18 am

Add the path and then just rename the sublime_text.exe to subl.exe and you will be ready to go :)
sunu0000
 
Posts: 1
Joined: Sun Apr 08, 2012 1:17 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 18 guests