command 'subl Gemfile' does not work


I tried 'subl Gemfile' as they said for the command, but 'subl' is not recognized as a command. How do I "recognize" sublime from cmd?



After installing sublime_text you will have an executable sublime_text. As root, copy this to somewhere in your executable path (ie /opt). You can also install it some where and add that somewhere to your executable path.

You should now be able to execute from the command line with: $ sublime_text

But you want $ subl

Two ways to do that.

Create a new link or create an alias.

Link: As root, in the directory that you installed the sublime_text executable, issue the command:

# ln -s sublime_text subl

if you do an ls -p you should now see a link created and you should be able to launch sublime text with the subl command.


This is probably the preferred method if you are on a single user system. Install sublime_text as above so that the sublime_text command works.

In your .bashrc or your .profile file, add the line:

alias subl='sublime_text'

Save the file. Now each time you execute a shell, you will be able to execute sublime_text by using just:

$ subl

Also you should now be able to open Gemfile if you are in the directory Gemfile is in and you issue the command: $ subl Gemfile

This is general Unix knowledge and has nothing to do with sublime text or with Rails.

Have fun!