Meu MAC OS é o Yosemite 10.10, que tem uma versão antiga do curl. Eu instalei as ferramentas de linha de comando Xcode e Xcode.
I run cURL with the "sudo" command as “sudo curl”:
sudo curl
Password:
curl: try 'curl --help' or 'curl --manual' for more information
However, when I run curl under the common user in the the terminal, it failed as follows:
dyld: Library not loaded: /usr/lib/libcurl.4.dylib
Referenced from: /usr/bin/curl
Reason: Incompatible library version: curl requires version 7.0.0 or later, but libcurl.4.dylib provides version 5.0.0
Trace/BPT trap: 5
I also downloaded the curl version of 7.43, and installed in /usr/local/bin.
— "which curl” shows “/usr/local/bin/curl”
— otool shows:
otool -L /usr/local/bin/curl
/usr/local/bin/curl:
/usr/local/lib/libcurl.4.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
otool -L /usr/local/lib/libcurl.4.dylib
/usr/local/lib/libcurl.4.dylib:
/usr/local/lib/libcurl.4.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
No entanto, o curl ainda funciona com o "sudo", mas falhou para o usuário comum, ou seja,
dyld: Library not loaded: /usr/local/lib/libcurl.4.dylib
Referenced from: /usr/local/bin/curl
Reason: Incompatible library version: curl requires version 8.0.0 or later, but libcurl.4.dylib provides version 5.0.0
Trace/BPT trap: 5
Enquanto isso, a solução anterior ( tentando instalar curl com homebrew, obtendo "versão de biblioteca incompatível" para libcurl.4.dylib ) não funcionou no meu caso.
- Mais ----
Na verdade, os comandos que parecem chamar o libcurl não foram executados com as mesmas informações, por exemplo:
- MacPorts:
[user @MBK ~]$port
dlopen(/opt/local/libexec/macports/lib/pextlib1.0/Pextlib.dylib, 6): Library not loaded: /usr/lib/libcurl.4.dylib
Referenced from: /opt/local/libexec/macports/lib/pextlib1.0/Pextlib.dylib
Reason: Incompatible library version: Pextlib.dylib requires version 7.0.0 or later, but libcurl.4.dylib provides version 5.0.0
while executing "load /opt/local/libexec/macports/lib/pextlib1.0/Pextlib.dylib"
("package ifneeded Pextlib 1.0" script)
invoked from within "package require Pextlib 1.0"
(file "/opt/local/bin/port" line 47)
- Netcdf:
[user@MBK ~]$ncdump
dyld: Library not loaded: /opt/local/lib/libcurl.4.dylib
Referenced from: /opt/local/bin/ncdump
Reason: Incompatible library version: ncdump requires version 8.0.0 or later, but libcurl.4.dylib provides version 5.0.0
Trace/BPT trap: 5
Mais uma vez, os comandos com o "sudo" funcionam.