command not found

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

command not found

Greg Novack
Dear MacVimmers,

It seems that whenever I update my GUI vim for the mac, or create a new user and open Vim.app in that new user, the following happens: I have shortcuts defined to call LaTeX on the current documents.  These work fine normally.  After an upgrade, I get this business:

    :!latex foo.tex
    /bin/bash: line 1: latex: command not found

    shell returned 127

This is BS of the highest order!  Yes, I properly copied .vimrc and .gvimrc.  Why on earth is Vim.app not recognizing certain commands?  Everything works 100% OK when I use Terminal vim.

What's also strange is that this problem appears to spontaneously resolve itself after some period of time, and also sometimes spontaneously reappears.

Thanks,
Greg
Reply | Threaded
Open this post in threaded view
|

Re: command not found

Michael Henry-5
Greg Novack wrote:
 > Dear MacVimmers,
 >
 > It seems that whenever I update my GUI vim for the mac, or create a
 > new user and open Vim.app in that new user, the following happens: I
 > have shortcuts defined to call LaTeX on the current documents.  These
 > work fine normally.  After an upgrade, I get this business:
 >
 >     :!latex foo.tex
 >     /bin/bash: line 1: latex: command not found
 >
 >     shell returned 127
 >
 > This is BS of the highest order!  Yes, I properly copied .vimrc and
 > .gvimrc.  Why on earth is Vim.app not recognizing certain commands?
 > Everything works 100% OK when I use Terminal vim.

I suspect this is a PATH problem.  I'm a recent mac switcher, and I've
yet to track down the proper way to change the default PATH for
applications launched "via the GUI" (double-clicking in the Applications
folder in Finder or launching via QuickSilver).  When I launch gvim via
the GUI, my PATH is set as follows:

     :echo $PATH
     /usr/bin:/bin:/usr/sbin:/sbin

My work-around for this problem is to launch gvim from the command-line
instead of via the GUI, though I'd be happy to learn the "proper" way to
set my PATH for GUI-launched apps.

 > What's also strange is that this problem appears to spontaneously
 > resolve itself after some period of time, and also sometimes
 > spontaneously reappears.

I can't explain the spontaneous disappearances and recurrences of the
problem if you are always launching gvim the same way.

Hope this helps,
Michael Henry
Reply | Threaded
Open this post in threaded view
|

Re: command not found

Chris Devers
On May 13, 2007, at 6:14 AM, Michael Henry wrote:

> I suspect this is a PATH problem.  I'm a recent mac switcher, and I've
> yet to track down the proper way to change the default PATH for
> applications launched "via the GUI" (double-clicking in the  
> Applications
> folder in Finder or launching via QuickSilver).

Set it in an XML plist file in

     ~/.MacOSX/environment.plist

For details, see e.g.

http://developer.apple.com/qa/qa2001/qa1255.html
http://developer.apple.com/qa/qa2001/qa1067.html
http://www.astro.washington.edu/owen/AquaEnvVar.html

Etc.


--
Chris Devers
Reply | Threaded
Open this post in threaded view
|

Re: command not found

Greg Novack
In reply to this post by Greg Novack
Well, it seems I stumbled across a solution by accident.  Thanks to Michael and Chris for the suggestions.  I think what I just found is easier.  It seems that for some reason there were outdated versions of the files "gvimrc" and "vimrc" (no periods) located in /blah/Vim.app/ -- sitting right next to the Contents folder.  Newer versions of these files are found in /blah/Vim.app/Contents/Resources/Vim, sitting right next to the Runtime folder.

Anyway, deleting the older versions sitting "up front" seemed to solve things.  I stumbled across this because I remembered that in order for "delete" to behave like it should, I had to copy a section of the "vimrc" (no period) from good ol' console vim into /blah/Vim.app/Contents/Resources/Vim/vimrc.  (The set backspace=2 business).  The copied portion has nothing to do with paths, so that isn't what solved my problem.  It must be that Vim.app was reading the old vimrc/gvimrc, and that deleting them caused Vim to look at the ones it should have been looking at all along.

So now I wondered why *old* vimrc and gvimrc are sitting in /blah/Vim.app/ while at the same time the *real* ones are sitting where they belong.  This is for the 7.0.188 binary I just downloaded.  A quick check of my old version, which was 7.0x (can't recall), reveals no such outdated files sitting where they don't belong.

Or maybe they do belong there and I've screwed everything up.  Whatever, I can now call LaTeX again without troubles.

-G


Thus spake Greg Novack [05/13/07 @ 03.14.23 -0500]:

> Dear MacVimmers,
>
> It seems that whenever I update my GUI vim for the mac, or create a new user and open Vim.app in that new user, the following happens: I have shortcuts defined to call LaTeX on the current documents.  These work fine normally.  After an upgrade, I get this business:
>
>     :!latex foo.tex
>     /bin/bash: line 1: latex: command not found
>
>     shell returned 127
>
> This is BS of the highest order!  Yes, I properly copied .vimrc and .gvimrc.  Why on earth is Vim.app not recognizing certain commands?  Everything works 100% OK when I use Terminal vim.
>
> What's also strange is that this problem appears to spontaneously resolve itself after some period of time, and also sometimes spontaneously reappears.
>
> Thanks,
> Greg