Git clone command not working [duplicate] - macos

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.

Related

How to install OS X 10.12 command line tools on 10.11?

I get this error when trying to brew install geckodriver
==> Installing geckodriver dependency: rust
==> Downloading https://static.rust-lang.org/dist/rustc-1.42.0-src.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/rust/1.42.0 --release-channel=stable
==> make
Last 15 lines from /Users/nilshaus/Library/Logs/Homebrew/rust/02.make:
2020-04-12 21:13:48 -0400
make
make: error: unable to find utility "make", not a developer tool or in PATH
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX10.12.sdk" cannot be located.
clang: error: unable to find utility "clang", not a developer tool or in PATH
Do not report this issue to Homebrew/brew or Homebrew/core!
These open issues may also help:
Rust dependents that currently fail to build from source https://github.com/Homebrew/homebrew-core/issues/50815
Error: You are using macOS 10.11.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.
Obviously 10.11 is no longer supported by Homebrew. The fact that it can't find make is weird, but I'm willing to bet that the real issue is that the rust build expects the 10.12 command line tools. Is there a way for me to install them on OS X 10.11? I have Xcode 8.
I encountered this same error message when brew upgrade installed a new version of clang and tcl-tk. Found a workaround here:
Xcode was overriding the command line tools install. After moving
Xcode to the trash I found the directory of the command line tools
install:
clang --version
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
/Library/Developer/CommandLineTools/usr/bin
https://github.com/pytorch/pytorch/issues/1139#issuecomment-302967251
Another possible workaround - instead of moving Xcode, choose one of the following to specify CLT version:
sudo xcode-select -s /Library/Developer/CommandLineTools
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
To display the current CLT path: xcode-select -p
https://github.com/pytorch/pytorch/issues/1139#issuecomment-303033942

Error Message "Xcode alone is not sufficient on Sierra"

I'd like to install openCV to vectorize image, but there's a series error message regarding Xcode and Ruby.
First, I use terminal to install openCV, brew install opencv.
Then, I got error message indicating that the system doesn't like my ruby version.
/usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `<main>':
Homebrew must be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)
So, I want to upgrade my ruby. I followed several update strategy from this post. First ruby upgrade trial: brew link --overwrite ruby & brew unlink ruby && brew link ruby and get
Error: No such keg: /usr/local/Cellar/ruby
Then second ruby upgrade trial: brew upgrade ruby and see the following error message.
Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
xcode-select --install
This error message means I need to install Xcode which I already install. So, I check my Xcode status with code-select -p and get /Applications/Xcode.app/Contents/Developer which means I am fine.
I saw a comment regarding where you install python could be a big issue. Quote from the source:
If you see /usr/local/bin/python3 then you are correctly using the Homebrew version of Python. If the output is instead /usr/bin/python3 then you are incorrectly using the system version of Python.
I check which python3 and get
/Users/******/anaconda3/bin/python3
Could this be the problem? How can I change system version to local?
Let me explain this myself so people won't make the same mistakes.
When I saw the last line of the error message
Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
xcode-select --install
My thought was: I already have Xcode why the system ask me to "reinstall" it. However, thanks for #SamiKuhmonen # Beartech #patrick kuang suggestion, I search a page (in Mandarin). xcode-select --install does not reinstall the whole Xcode. It means install some missing command line tools which is required by installing Ruby.
Trying to install k8s package via brew , I just got the same issue a while ago saying in the terminal :
Error: Xcode alone is not sufficient on Sierra.
Install the Command
Line Tools: xcode-select --install
You need to download *.dmg file; named Command Line Tools (macOS x.x.x) for XCode N . Search on it here : https://developer.apple.com/download/more/ . You must have developer account.
Then, congrats! 🎉
update for 2019
macOS Mojave 10.14.5
Use Xcode10.2 for macOS 10.14
I had the same issue in my Macbook Pro on Sierra. Apart from updating Xcode from the App Store, I also installed the command line utilities using the xcode-select --install command.
After the update steps, brew commands started working fine. I also updating my OS during this time.
I got the same message despite having Xcode and the command line tools already being installed a long time ago and updated numerous times.
I think it is the Apple way of telling you that Xcode command line tools need to be updated, as the App Store showed me the below:
After executing the xcode-select --install command, the update disappears from the App Store, which means they are exactly the same thing.
I had the same problem. I installed 'Command Line Tools for XCode' (choose appropriate version) from https://developer.apple.com/download/more/ and restarted my terminal. Issue resolved :)

Issues while trying to run git uninstall.sh on Mac OS

I wanted to try to update Git on my Mac OS to the latest version and it says to run the provided uninstall.sh first. I must confess that I ran the pkg before reading the "Read me". Not sure if that screwed it all up ...
Now I am not big with the terminal and found the following command to run a shell script:
$ sh uninstall
but that resulted in:
/usr/sbin/uninstall: /usr/sbin/uninstall: cannot execute binary file
where I got stuck now.
Any idea what I have to do to resolve this error?
You should run the uninstall.sh packaged with your previous distribution of Git, as explained in "Install and Update to latest version Git on Mac OSX 10.10 Yosemite":
Upgrading Git from a previous version to the latest 2.0.1
If you have previously installed Git you can upgrade to the latest version by uninstalling the previous install using the uninstall.sh file with the installation.
Go through the same process of downloading and mounting and the .dmg – then launch the Terminal.
uninstall and uninstall.sh are two different things. The former is a binary that comes with the os, the latter is a shell script that comes with the package.
Try: sh uninstall.sh instead

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

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.)

Unable to get MacPort functionality after installing Xcode 4.3

I am having trouble getting MacPorts to function properly. I just installed OSX Lion 10.7.3 I downloaded and installed MacPorts first, and then after reading the requirements, I downloaded Xcode4.3 from the App Store, and then installed it. I launched Xcode and it looks to be operational and functional. However when I attempted to port with MacPorts, it gave me this error message(excerpt):
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
I followed the advice from:
How do i install additional packages for Xcode on OSX Lion to allow MacPorts to work
and installed command_line_tools_for_xcode from the Preferences within Xcode. I closed Xcode, and again got the errors:
$ sudo port install libsocketsPassword:
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
---> Computing dependencies for libsockets
---> Dependencies to be installed: openssl zlib
---> Extracting zlib
Error: Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version').
Error:
Error: If you have not installed Xcode, install it now; see:
Error: http://guide.macports.org/chunked/installing.xcode.html
Error:
Error: Target org.macports.extract returned: unable to find Xcode
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
Error: The following dependencies were not installed: openssl zlib
Error: Status 1 encountered during processing.
I am uncertain where to go next with this. How do i trouble shoot my Xcode and MacPort interface?
In theory this should work if you have Xcode4.3 installed (in /Applications):
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
(And you've installed the optional command line tools)
Everything will start working fine after installation of "Command Line Tools for Xcode" package.
You can get it from here: https://developer.apple.com/downloads/index.action#
Please see the MacPorts migration instructions for Xcode 4.3.
The instructions are pretty involved. You need to run xcode-select to set a new tools path, update developer_dir in macports.conf (as described by Henk Poley), re-install MacPorts (ouch), and finally uninstall and re-install all of your ports (double ouch).
Edit: libpvx still wouldn't install after the above. Two extra steps were required:
sudo ln -s /Developer /
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /SDKs
YMMV if you have different ports installed!
Also in /opt/local/etc/macports/macports.conf change the line with developer_dir to point to / instead of /Developer.
After
sudo xcode-select -switch /Applications/Xcode.app
I also had to run
sudo xcodebuild -license
and accept the licence
Here is a solution that has worked for me:
Install Command Line Tools for Xcode
Xcode -> Preferences -> Downloads
Help MacPorts find the right Xcode folder
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app
Create symbolic links for clang compilers as they now live elsewhere
sudo ln -s `which clang` /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s `which clang++` /Applications/Xcode.app/Contents/Developer/usr/bin/
Try using trunk, there's no release supporting Xcode 4.3 yet.
Setting the developer path in /opt/local/etc/macports.conf works for me,
developer_dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
since most of the compilers are stored there now instead of /usr/bin under Developer.
None of this works for me. Wait for macports to release a new version that officially supports XCode 4.3+
sudo mv /usr/bin/xcodebuild /usr/bin/xcodebuild.old
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild /usr/bin/xcodebuild
Starting with Xcode 4.3, the command-line build tools are not installed by default. Launch Xcode, open the Preferences, and go to the Downloads tab. From there you should have an option to install the command-line tools.
You can also download them from the web here: https://developer.apple.com/downloads/index.action
Disclaimer: I haven't installed Xcode 4.3 yet. I have only read about it on the web.
As of 27/2/2012, the official suggestion from MacPorts seems to be to not use XCode 4.3 and instead use 4.1 through 4.2.1, which can be downloaded from Apple.
There is a bug ticket which might be useful to follow the evolution of this.
Incidentally, and as reported in my comment #11 in that bug report, I am able to build ports without warnings by using the 2 most sane-looking suggestions found in this question: sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer and changing developer_dir in /opt/local/etc/macports/macports.conf to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
I have macports installed without admin/root privileges, so I was unable to test the xcode-select answers. However, I observed that Pall Melsted's answer worked, but not initially. What I found out was that I had not accepted the Xcode 4.5 license agreement!
If you have just installed Xcode for the purposes of macports, and you haven't accepted the Xcode license yet, you might get the error presented by the original post. When I checked my Xcode version using /usr/bin/xcodebuild -version, I was given the prompt to read and accept the license. After doing so, and after having made the changes suggested by Pall to the macports.conf developer_dir, it all works now.
As alternative: you can make downgrade of Xcode to 4.2.1 version. DMG of Xcode 4.2.1 placed here: https://developer.apple.com/downloads/index.action
After this MacPorts became works fine for me.
This is fixed in MacPorts 2.0.4.
To upgrade:
Download MacPorts 2.0.4 from the install site or run sudo port selfupdate.
Run the MacPorts migration described here to reinstall all ports. This is painful but required to get back to a working state.
You should definitely run sudo xcode-select -switch /Applications/Xcode.app like everyone here says, that'll fix many problems, but certainly not all.
Afaik, all the remaining problems exist within the configuration information for various packages. You might simply reinstall MacPorts as described in the migration instructions, but I found another solution.
You should begin finding all effected port files using commands like grep /Developer/ ..., after executing sudo bash and cd /opt/local naturally.
You should identify all effected ports by using port provides ..., which I piped through sed and sort | uniq. You could simply reinstall all these ports using either port -n upgrade --force ... or separate port uninstall ... and port install ... commands.
I recommend using one large port -n upgrade --force ... command to avoid duplicate rebuilds of dependencies, using the separate uninstall and install commands afterwards.
There are of course various ports for which /Developer exists only inside text config files, meaning you can fix them manually with sed -i -e 's/\/Developer//g' ..., but you cannot do so with binaries obviously.
I'm afraid you must at minimum rebuild all your Python and Perl installations, making this upgrade an ideal time to clean out packages that depend upon older versions, ala python26 and perl5.8.
There are several technically effected ports I decided against rebuilding like fuse4x-kext, who contained /Developer inside Library/Extensions/fuse4x.kext/Contents/MacOS/fuse4x but hasn't prevented sshfs from working correctly.
I had initially installed xcode 3.2.2, after which I installed 4.3. When I ran the xcode-select, I still got the same error about no xcode project in /Applications. I then dug into the /usr/bin/xcodebuild script and found out that this was working correctly, and another instance of xcodebuild (the one installed with xcode 4.3, not the one in /usr/bin) was being run and returning the error:
xcodebuild: error: The directory /Applications does not contain an Xcode project.
It seems the /usr/bin/xcode-select does not work for xcode 4.3, (it's compiled so you can't really see why it's not working). Strings doesn't give any clues. Good thing osx has strace.. oh wait.
Anyways, the best I could do was modify /opt/local/etc/macports.conf
and uncomment the line containing the path to the xcode installation. That seems to fix my problem for the most part.

Resources