I downloaded Textmate (1.5.10) on a new MacBookPro (MacOSX 10.6.7) after using it to typeset LaTeX on my old MacBook. I saved my document folders on my new computer in the same document folder structure and was unable to typeset the .tex documents. I got the response:

The current PATH is:


Please add the directory containing “kpsewhich” to PATH in TextMate's Shell Variables preferences.

In my TextMate preferences, Advanced>Shell Variables> - I have four categories checked off: PATH /usr/local/bin:/usr/X11/bin, PATH /usr/bin:/bin:/usr/sbin:/sbin, _MyCompanyName__ TM_ORGANIZATION__NAME, & (I tried adding) MY_VARIABLE /usr/texbin

When I click on the Terminal link to "Set PATH and Relaunch", this is what I get:

Last login: Fri Jun 17 16:06:39 on console
defaults write com.macromates.textmate OakShellVariables -array-add "{ enabled = 1; variable = PATH; value = '$PATH'; }" && open "/Users/annlmontgomery/Downloads/TextMate.app"
Ann-Montgomerys-MacBook-Pro:~ annlmontgomery$ defaults write com.macromates.textmate OakShellVariables -array-add "{ enabled = 1; variable = PATH; value = '$PATH'; }" && open "/Users/annlmontgomery/Downloads/TextMate.app"
Ann-Montgomerys-MacBook-Pro:~ annlmontgomery$ 

But I don't know what to do this step - I'm just learning LaTeX and have no programming experience.

additional note:
I do have MacTex and I included "/usr/texbin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin" in the Shell Variables preferences and when I typeset, now I get "env: ruby: No such file or directory" ...any ideas? –

additional note: I have TexShop 2.41 installed

additional note:

in Preferences>Shell Variables - I now have

PATH /usr/texbin:/usr/local/bin:/usr/X11/bin

PATH /usr/bin:/bin:/usr/sbin:/sbin/

PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin

PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/texbin

PATH /usr/texbin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin

PATH /usr/bin/usr/texbin:/usr/local/bin:/usr/X11/bin

and when I Typeset - I get "env: ruby: No such file or directory" BTW thanks for everyone's efforts

  • 1
    Did you install MacTeX?
    – Joseph Wright
    Jun 17, 2011 at 20:38
  • I use TextMate and in TextMate's Shell Variables preferences. : I 've /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin in the terminal : $ echo $PATH gives /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin. When you install MacTeX, the PATH must contain /usr/texbin Jun 17, 2011 at 20:51
  • You just need to add /usr/texbin to your PATH. Either make a new path variable or add /usr/texbin: to the front (or :/usr/texbin to the end) of one of the existing ones. Jun 17, 2011 at 20:59
  • While the path can go wrong, I still think we need to know first that MacTeX is installed at all. That is far from clear from the question.
    – Joseph Wright
    Jun 18, 2011 at 6:28
  • You are missing /usr/bin from your PATH.
    – egreg
    Jun 18, 2011 at 12:40

2 Answers 2


I downloaded TextMate and changed the only PATH in the preferences to read


It worked. You might add other directories to the PATH, but remember to separate them by colons. For example


Thanks everyone...so for future cases...this is what I did:

  1. Uninstalled everything: in Finder - control click on TextMate and TexShop and selected 'show package contents' and dragged that to trash

  2. In Finder - User/Library/ dragged TexShop to trash

  3. In Finder - User/Preference/ dragged to trash com.macromate...' files andTexShop' files

  4. Emptied trash

  5. Redownloaded TexShop and TextMate and installed them

  6. In TextMate Preference>Advanced>Shell Variables unselected the PATH provided and created a new PATH and inserted the pathway above from egen /usr/texbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

  7. Closed everything and restarted the computer

  8. Everything works...again, thanks to everyone for your help (esp over the weekend)...

  • 2
    nice to know it worked. I guess that trashing TextMate and TeXShop is a bit drastic and probably it's not needed. Moreover, TeXShop is completely independent from the TeX distribution. Also restarting should not be needed: you've a Mac, not a W. box. :-)
    – egreg
    Jun 19, 2011 at 18:00
  • I just re-downloaded Textmate and deleted the the /Users/yo/Library/Application Scripts/ folder and everything worked fine again. (note: all your preferences will be wiped when doing this)
    – Mint
    Feb 17, 2015 at 22:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .