If you are running a non-system Emacs on OS X and have tried to use “emacsclient”, you may have seen the following error message despite having started the Emacs server:
1234567
1 2 3 4 5 6 7
<span class='line'>emacsclient: can't find socket; have you started the server?
</span><span class='line'>To start the server in Emacs, type "M-x server-start".
</span><span class='line'>emacsclient: No socket or alternate editor. Please use:
</span><span class='line'>
</span><span class='line'> --socket-name
</span><span class='line'> --server-file (or environment variable EMACS_SERVER_FILE)
</span><span class='line'> --alternate-editor (or environment variable ALTERNATE_EDITOR)</span>
This doesn’t work because you are invoking “/usr/bin/emacsclient” which came with the OS, instead of “/Applications/Emacs.app/Contents/MacOS/bin/emacsclient”. This can easily be fixed by symlinking the latter to “/usr/local/bin/emacsclient” and making sure that “/usr/local/bin” is listed in your path before “/usr/bin”.
Not a big deal, but it took me a couple of minutes to figure out and I thought I might as well save others some time…