thoughtbot/dotfiles — pull request #289 by tsigo (2014-07-28 03:12:06+00:00)
Title: Add zshenv file

From the [Zsh manual](http://zsh.sourceforge.net/Intro/intro_3.html):

> '.zshenv' is sourced on all invocations of the shell, unless the -f option is
> set. It should contain commands to set the command search path, plus other
> important environment variables. `.zshenv' should not contain commands that
> produce output or assume the shell is attached to a tty.

So why is this important? [Alfred](http://www.alfredapp.com/) workflows run in
non-interactive shells. When the `$PATH` is set or `rbenv` is initialized in
`zshrc` instead of `zshenv`, those workflows will not use the correct Ruby
version and might not have access to certain bin files, such as those from
`$HOME/.bin/` or Homebrew.

I've created a [simple workflow](http://cl.ly/450K3t3b423H) to demonstrate the
problem if you'd like to see for yourselves. Install it and type `rbenvtest`
into Alfred.

Before:

After: