/usr/lib/libwrap.7.dylib Error after install mac osx 10.8 - macos

I have problem with using git after upgrading to MAC OSX 10.8.2.
Trace shows that there is a missing lib file:
git push
dyld: Library not loaded: /usr/lib/libwrap.7.dylib
Referenced from: /usr/local/bin/ssh
Reason: image not found
which cause SSH to fail and then GIT since git use SSH.
Google around see ton of kind of similiar problem, but non seem to provide a working solution.
Any suggestion?

To fix this, unlink then reinstall your app. e.g. if you use Homebrew:
brew unlink git
brew install git --build-from-source
(Edit: I also ran brew install libtool --universal before the above. That may have also done it.)

Related

How to change Homebrew's prefix?

I'm using MACOS M1, and started to install brew under ARM. Then at the other day, I installed some formula under x86.
When I run a command
brew doctor
And I got this message
Some of Homebrew's bottles (binary packages) can only be used with the default
prefix (/usr/local).
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
unsupported configuration.
How to change the prefix to /usr/local/?
When I run which -a brew I got this result
/opt/homebrew/bin/brew
/usr/local/bin/brew
Thanks in advance.
I had the same issue because I did not installed the homebrew from the local path on my terminal.
I just uninstalled the homebrew, installed it again (from the local path this time) and it is fine now.
To uninstall Homebrew, run the uninstall script from the HomeBrew/install repository.

How to install Homebrew Portable Ruby when your system version is too old

I'm trying to install Homebrew on macOS. Once the installation finished, when I typed help I got:
Already downloaded: /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Error: Checksum mismatch.
Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104
Actual: f80fd4cc877a64b0ac1c105fdc212ca6be08bb034118900f2c2f58edcfe0dafd
Archive: /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!
I had the same question, and the solution is simple: remove the portable-ruby-2.6.3.mavericks.bottle.tar.gz you downloaded before.
rm /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Try running brew update-reset in your terminal and then run brew upgrade in the same terminal.
"Homebrew install fails with Error: Failed to install Homebrew Portable Ruby" helped me tremendously.
It would fail to install, because our company firewall was blocking certain downloads, like bottle, during the Homebrew update/install, but it was difficult to determine this because I would get the error above.
After removing the file, try
brew upgrade
brew update
on your personal Wifi or your phone's hotspot.
I fixed it.
First, I deleted the brew file that stores in the Library folder when using macOS.
The failure before was due to the connection. When I make sure the connection worked, it worked.
Remove the Homebrew Portable Ruby tar.gz from your Mac using:
rm <the path.tar.gz>
rm -rf <the path.tar.gz>
I've been automating this for years. There is a new something(?) in play during the Homebrew install.
I had the same error as above. I filed an issue report and got a response that fixed my problem:
CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
I'm not sure what prefixing with CI=1 does but all my automation issues went away.
To retry an incomplete download, remove the file above, then run:
rm /.../Library/Caches/Homebrew/portableruby-2.6.3.mavericks.bottle.tar.gz
and try again
my problem was:
Already downloaded: ../Library/Caches/Homebrew/portable-ruby-2.6.8_1.el_capitan.bottle.tar.gz
==> Pouring portable-ruby-2.6.8_1.el_capitan.bottle.tar.gz
Error: Failed to install ruby 2.6.8_1!
Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!
Fixed with opening the system app for terminal and installing Rosetta into the prompt. This happened after system update MacOS to 11.6.7
After resolving this brew did brew upgrade finish well.
Hope this helps someone.
Here is how I fixed it:
brew cleanup then brew upgrade

vim ruby mismatch on Mac High Sierra

I recently upgraded my Mac to High Sierra
After the upgrade, Macvim (mvim) stopped working because (I assume) HighSierra upgraded ruby to 2.3, and mvim is using ruby 2.0.
Following is the error I am getting
dyld: Library not loaded:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib
Referenced from: /usr/local/Cellar/macvim/8.0-134/MacVim.app/Contents/bin/../MacOS/Vim
Do I need to compile vim again or is there any way to fix this problem?
Thanks in advance.
This worked for me. YMMV
brew uninstall --purge macvim
brew install macvim
[amended] Regarding the upgrade alone option, that may work if you don't have the current version already. The --purge forces a removal and complete reinstall.
Also, the build from source option, while it may work, you now own your own mac-vim static snapshot and need to maintain it manually as the app evolves.
I'd avoid building from source unless you have very specific needs.
First find where is the right libruby path, mine is: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.2.3.0.dylib
It is common that the version has changed.
Find out where the absolute path of vim is:
$ which vim
vim: aliased to your-path-of-vim
change dyld:
sudo install_name_tool -change /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.2.3.0.dylib your-path-of-vim
➜ ~ vim
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
I tried brew uninstall install update... All failed. And install_name_tool works for me.
install_name_tool -change /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.2.3.0.dylib /usr/local/bin/vim
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]$
What helped in my case was:
brew link --overwrite vim
In your case, it might be useful to use the same command for MacVim
brew link --overwrite macvim
Tried to use brew upgrade macvim an error was raised and the failed. What worked for me is to open the MacVim in a normal window (not a iTerm or terminal) the graphic version noticed that a newer version is available and asked if I want to update. Clicked yes, please and done. macvim in terminal or iTerm works just fine (as well as the "window" version).

Git clone command not working [duplicate]

I am using the command git clone ssh://.... and getting the following error on the terminal:
dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/git/bin/git
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/git/bin/git
Expected in: /usr/lib/libSystem.B.dylib
Trace/BPT trap: 5
I needed to install command line tools from Xcode. To do so-
Open Xcode and hit Cmd+,
Click Downloads
Install command line tools.
http://www.hongkiat.com/blog/mountain-lion-git-fix/
Had the same problem. I have OS X 10.8, so XCode was not a solution for me.
Turns out I had a Git version that's not compatible with my OS X version
This info might help(found it googling :) ):
If you are running:
10.6 Snow Leopard: git-2.2.1-intel-universal-snow-leopard
10.7 Lion: git-2.2.1-intel-universal-snow-leopard
10.8 Mountain Lion: git-2.2.1-intel-universal-snow-leopard
10.9 Mavericks: git-2.2.1-intel-universal-mavericks
10.10 Yosemite: git-2.2.1-intel-universal-mavericks
You can download from here:
http://sourceforge.net/projects/git-osx-installer/files/
I was also having troubles with the same error. I tried the PATH and .bash_profile tricks (didn't help). I wasn't really interested in installing Xcode and then the 'Command Line Tools' as others had suggested. But I did stumble upon half an answer.
First, I uninstalled my current version of Git (1.9.2). I then found that it is possible to install the Command Line Tools by themselves, without installing Xcode:
Xcode page: https://developer.apple.com/xcode/
Downloads near the top
Scroll down to 'Additional Tools'->'View Downloads'
Command Line Tools (OS X Mountain Lion)
With those installed, doing 'git --version' returned this:
git version 1.8.5.2 (Apple Git-48)
The file "/usr/lib/libSystem.B.dylib" was untouched during this process. Or at least, the file size and date did not change. Since that library didn't change, I would surmise that it isn't Xcode that is fixing things, but the version of Git that is installed.
I thought about testing that theory and found the older source code for various versions of Git, but didn't have time to spend compiling/installing/testing each one to see if this theory is correct. And I didn't see a simple method of uninstalling the 'command line tools'. Maybe someone else is more intrepid. :)
-- J
One can also look at https://stackoverflow.com/a/19457333/894120 and just make a .bash_profile, that worked for me.
The issue is that the git maintainers only support MaxOS10.9 (mavericks). If you have an earlier version, you can't use their distribution.
Recommended by somebody else at work - use (home)brew. Basically with brew installed you can merely use:
brew install git
and it will give you an up to date version. Subsequently to get a new version use:
brew upgrade git
Now brew itself uses git, so it might be that this install is recursive - I had to install it recently for another purpose and it took me several hours - but once you have it there, things should be OK. All I can say is that when I installed brew originally, "git" still referred to the 1.8.x Apple version, and with this change I'm now getting git v2.1.0.
I was also plagued with git causing the dreaded:
dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/bin/git
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/bin/git
Expected in: /usr/lib/libSystem.B.dylib
After reading many successfully executed suggestions revolving around updating xCode (>2G) or just the Command Line Tools part of xCode (~200M) I installed the Command Line Tools and this fixed my problem when using git from the command line.
Interestingly, I was having trouble with PyCharm getting the same error, even after I did the update. I was able to fix this by changing the path where git was found (In PyCharm->Preferences...->Version Control->Git, I changed /usr/local/bin/git to /usr/bin/git near the top):
Image of PyCharm->Preferences...->Version Control->Git
I finally figured out exactly what’s going on -- and to pay homage to all the help I received from the web, want to share the specifics:
I discovered there were two versions of git installed on my machine:
/usr/bin/git
/usr/local/git/bin/git
(also interestingly: /usr/local/bin/git -> ../git/bin/git)
Some suggestions for putting /usr/bin in the path are somewhat helpful, but might not solve the niggling problem that there’s a version of git installed that doesn’t work.
So note this:
$ pwd
/usr/local/git/bin
$./git --version
git version 2.8.1
And:
$ pwd
/usr/bin
$ ./git --version
git version 1.8.5.2 (Apple Git-48)
The Apple git version is the one that works -- this is the one likely installed by installing the Command Line Tools from xCode. Note the paths in each. Also note that you don't necessarily have to install the whole Command Line Tools, just a proper version of git.
Further, in the /usr/local/git/bin/ directory, there’s an uninstall.sh script. In that script, it uses pkgutil to uninstall the version of git. (You should use this script to do the uninstall.) You can run this line to verify that this utility has record of installing git:
pkgutil --packages | grep com.git.pkg
This is not the version you want. You want the Apple version. Use the script in the /usr/local/git/bin to uninstall the broken version of git.
Uninstalling it assures you will never get this error, and that you will be using the proper version of git.
Hope that helps some others. The info was good but incomplete. And there was almost nothing for PyCharm.

dyld: Library not loaded: /usr/local/lib/liblua.5.1.5.dylib

I got the following error while trying to invoke terminal Vim (terminal app from MacVim directory); after I updated homebrew, rvm & reinstalled a new version of Ruby.
dyld: Library not loaded: /usr/local/lib/liblua.5.1.5.dylib
Referenced from: /Applications/MacVim.app/Contents/MacOS/Vim
Reason: image not found
Note: Was able to solve it, so thought I would record if someone stumbles on the same issue.
I use vim installed by homebrew ,my solution is reinstall vim
run
brew reinstall vim
The problem seems to because homebrew somehow removed the old version of lua that was required for Vim to run.
So installed the specific version from homebrew like this:
Search homebrew for available formulae: brew search lua; got:
lua
lua51
luabind
luajit
luarocks
homebrew/nginx/lua-nginx-module
Installed: brew install lua51
This solved the issue. I am posting it may be able solve other brew related issues connected with installing different versions of packages.
I had the similar message:
dyld: Library not loaded: /usr/local/opt/lua/lib/liblua.5.2.dylib
Switching version helped to me:
$ brew switch lua 5.2.1
Error: lua does not have a version "5.2.1" in the Cellar.
Versions available: 5.2.4_1, 5.2.4_3, 5.2.4_4, 5.3.4_2
$ brew switch lua 5.2.4_4
Cleaning /usr/local/Cellar/lua/5.3.4_2
Cleaning /usr/local/Cellar/lua/5.2.4_3
Cleaning /usr/local/Cellar/lua/5.2.4_4
Cleaning /usr/local/Cellar/lua/5.2.4_1
71 links created for /usr/local/Cellar/lua/5.2.4_4
Error:
dyld: Library not loaded: /usr/local/opt/lua/lib/liblua.5.2.dylib
Referenced from: /usr/local/bin/vim
Reason: image not found
[1] 30835 abort vim
Attempt:
brew switch lua 5.2
Error:
Error: lua does not have a version "5.2" in the Cellar.
Versions available: 5.2.4_4, 5.3.4_2
Solution:
brew switch lua 5.2.4_4
VIM running fine
In case your problem is caused by vi not being able to be found as editor. With an error like this:
dyld: Library not loaded: /usr/local/opt/ruby/lib/libruby.2.7.dylib
Referenced from: /usr/local/bin/vi
Reason: image not found
error: vi died of signal 6
error: There was a problem with the editor 'vi'.
It can be solved by setting Git's editor to vim:
git config --global core.editor $(which vim)
Here's the discussion where I got the solution to this case.
Try to run:
brew link lua
to see if that works.
Alternatively:
brew link --overwrite lua
➜ sudo vi
dyld: Library not loaded: /usr/local/opt/lua/lib/liblua.5.2.dylib
Referenced from: /usr/local/bin/vi
Reason: image not found
[1] 29504 abort sudo vi
It's because old version of lua that was required for Vim to run.
brew switch lua 5.2.4_4
I do the following steps, it's ok.
brew uninstall vim
brew install v

Resources