Upgrade OS X 10.8 -> 10.10 (Yosemite) breaks perl, homebrew, gvim


After upgrading from OS X 10.8 (Mountain Lion) to 10.10 (Yosemite), I found that gvim no longer worked and exited with a cryptic dyld message similar to dyld: Symbol not found:.

The first thing I tried was uninstalling it with homebrew, then reinstalling:

brew uninstall macvim
brew install macvim

But I got a Trace/BPT trap: 5 during make. Trying to fix this by doing the things suggested by brew doctor and installing openssl gave me essentially the same errors.

brew install openssl

/bin/sh: line 1: 71319 Trace/BPT trap: 5 /usr/bin/perl tools/c_rehash certs/demo
make[2]: *** [rehash.time] Error 133
make[1]: *** [openssl] Error 2
make: *** [build_apps] Error 1

However here I could see perl was used in the ./configure step. Trying to run my perl scripts, I found they no longer worked:

dyld: lazy symbol binding failed: Symbol not found: _Perl_Istack_sp_ptr
Referenced from: /Users/jl11/perl/lib/perl5/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle
Expected in: flat namespace

dyld: Symbol not found: _Perl_Istack_sp_ptr
Referenced from: /Users/jl11/perl/lib/perl5/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle
Expected in: flat namespace

My perl install appears to be broken, and that was what was causing all the problems. Something similar was encountered before:

I used perlbrew to fix the problem, and now it all works again! Run the following commands

curl -L | bash
perlbrew install stable ­-Dusethreads
perlbrew switch stable

I had a PERL5LIB environment variable set which caused problems, check your @INC:

perl -e 'print join "\n", @INC'

If it’s set put PERL5LIB= in your ~/.bashrc or equivalent

Finally, you may need to install your perl modules into the new perl version again, documented here. Also, be wary of using scripts which have #!/usr/bin/perl as their first line, as they will run using the wrong perl version. perl <script_name> is safer