Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't create a symbolic link with Textmate in Terminal. (mate: command not found)

I'm currently going through http://ruby.railstutorial.org/ and it uses the command "mate" to access Textmate through the terminal. I have had Textmate on my Macbook Air (Lion OS) since I first bought it, but when I try to use a command like "mate .gitignore" the terminal gives me "mate: command not found".

I've looked through all other StackOverflow questions regarding this topic and have done the following:

  • Attempted to create a symbolic link through the terminal with this code.

    $ sudo ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/bin
    

This code lets me enter my password and tells me the file exists, but still does not allow me to use the "mate" command.

  • Accessed Textmate/Help/Terminal Usage and tried to create a link for /usr/bin only for it to say operation not permitted.

  • Used alias mate='open -a textmate'. This works; however, I have to do it every time I open Terminal.

So, my question is can anyone tell me what is wrong? Love to figure this out!

Thank you!

like image 307
Griffin Lacek Avatar asked Mar 07 '12 23:03

Griffin Lacek


1 Answers

First, you should not add anything to /usr/bin. You should add it into /usr/local/bin. Further, getting the message "file already exists" from ln means that it did not create the link. Try this:

ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/local/bin/mate

Depending on your current setup, this may have to be run with sudo. In general, if you don't know whether to run something with sudo or not, try without first and see if you get a permissions error, then use sudo.

like image 134
Andrew Marshall Avatar answered Oct 08 '22 18:10

Andrew Marshall