11

I upgraded to mac os high sierra 10.13.1, and now when I try to run vim, I get this message.

dyld: Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib Referenced from: /usr/local/bin/vim Reason: image not found Abort trap: 6

What might I need to do to get vim working again?

I believe I have xcode installed, and also brew, the missing package manager for mac os, if that helps.

13

Did you install vim with homebrew?

Update homebrew and vim.
brew update
brew upgrade vim

(I'd recommend upgrading everything installed with homebrew brew upgrade - but be ready for things to break.)

You might also need to unlink and re-link vim.

On a 2nd look, it looks like it's due to broken ruby, only re-linking ruby might fix it, but upgrade is still a good idea. brew link --overwrite ruby

My homebrew packages often get broken by a macOS upgrade, it seems best to upgrade everything at the same time.

  • brew upgrade vim did the job – Rahul Prasad Jan 7 '18 at 16:19
  • If you have problems with ownership of /usr/local, try this. – Giles Gardam Aug 29 '18 at 19:01
4

Previous answers did not work for me. (did not try installing from source, didn't want to "own" my macvim at that level)

This did work: brew uninstall --purge macvim brew install macvim

  • 2
    This finally did the trick for me (using vim, not macvim). – SMT Nov 28 '17 at 16:32
2

All that stuff didn't quite work for me.

But uninstalling and reinstalling Vim worked.

brew uninstall vim
brew install vim
  • 1
    Do this one! It works! – fauverism Feb 16 '18 at 16:17
1
  1. $ brew doctor - let me know I needed to install xcode and fix my path to sbin
  2. $ xcode-select --install (installs xcode)
  3. I also had to add brew's sbin to my path in my .zshrc
  4. $ echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc (fixes path)
  5. $ source ~/.zshrc- (refresh .zshrc)
  6. $ brew install macvim
  7. $ brew upgrade

That did the trick. Now vim opens with $ vim

0

This worked for me:

$ brew update

$ brew upgrade macvim

actual command output:

[bin]$ brew upgrade macvim
==> Upgrading 1 outdated package, with result:
macvim 8.0-142
==> Upgrading macvim --with-override-system-vim
==> Downloading https://github.com/macvim-dev/macvim/archive/snapshot-142.tar.gz
==> Downloading from https://codeload.github.com/macvim-dev/macvim/tar.gz/snapshot-142
######################################################################## 100,0%
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --enable-ter
==> make
🍺  /usr/local/Cellar/macvim/8.0-142: 2,147 files, 34.2MB, built in 3 minutes 15 seconds
[bin]$ 
0

I've tried the previous answer, and I got an error while upgrading vim

brew upgrade vim
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 62f85cfa to af8f8f11.
Updated 1 tap (caskroom/cask).

Error: vim: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb:100: syntax error, unexpected <<
<<<<<<< Updated upstream
  ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb:101: syntax error, unexpected ',', expecting keyword_end
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb:103: syntax error, unexpected ',', expecting keyword_end
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb:105: syntax error, unexpected ',', expecting keyword_end

But I found using vim in system did work.

brew uninstall --force vim

The path is

where vi
/usr/bin/vi

And it worked.

0

If there is a conflict on vim version you have to run unlik macvim before installing. These steps worked for me.

brew uninstall vim

brew unlink macvim

brew install vim

0

This worked for me.

Check brew..

brew doctor
brew update

Download Xcode updates just in case..

xcode-select --install

Change your path and use an updated VIM image..

brew unlink vim
brew upgrade macvim

vim

VIM version 8.1.577

Curious if you can do this in macports?

-1

I have tried brew update && brew upgrade vim, but hit the same issue. Installing from source solved this issue eventually.

git clone https://github.com/vim/vim.git
cd vim
./configure
make install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.