I want to use the psql utility standalone, without installing postgress via brew or something (I have my reasons). I use psql version 9.5.3 on OS X, which was distributed with PostgressApp.
When I only distribute psql, I get the error:
dyld: lazy symbol binding failed: Symbol not found: _PQsslInUse
...
Expected in: /usr/lib/libpq.5.dylib
With the command otool -L psql I found path to the library was still pointing to Posgres.app, so I changed that with install_name_tool tool, and I also checked all referenced libraries and fixed them.
However, I still get the same error message. Anyone knows how to fix this?
Or another route to a working standalone psql binary?
I fixed it here: https://github.com/PostgresApp/PostgresApp/issues/338
The problem was I used install_name_tool not 100% correctly, and I forgot to create aliases.
Related
I'm trying to get Perl's Finance::Quote module working after MacOS upgrade to 11.4. One of the dependencies is B::Keywords. B::Keywords installation fails a test with this error:
> sudo cpan B::Keywords
[...]
Can't open /System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h: No such file or directory at t/11keywords.t line 25
Digging around, I see that keywords.h exists on my system in this location:
/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h
Is there a way to tell cpan (or cpanm, or some other installation tool) where to look for these headers? Or, any other approach to get this working would be welcome.
It seems like they removed the keywords.h from the CORE directory (relative to the path given from $Config{archlibexp}) for the system perl on macOS 10.14, see this bug report.
The reason you are not able to install B::Keywords is due to a failed test 11keywords.t see line 24. Some possible solutions:
Install the module without running the tests (sudo cpan -T B::Keywords)
Submit an issue at the GitHub issue tracker so the author of the module can fix the problem.
Install the module with perlbrew instead of using the system perl (I tested this and it worked fine here).
I am attempting to load the libspatialite extension in SQLite. As per the installation guide, I downloaded the latest libspatialite and moved the included libspatialite.1.1.3.dylib file to /usr/local/lib.
greg /usr/local/lib $ls | grep libspatialite
libspatialite.1.1.3.dylib
However, I was unable to load the extension.
sql> SELECT load_extension('libspatialite.1.1.3.dylib')
[2017-09-19 10:45:25] [1] [SQLITE_ERROR] SQL error or missing database (dlopen(libspatialite.1.1.3.dylib.dylib, 10): image not found)
I also tried storing libspatialite.1.1.3.dylib.dylib in the same directory as the sqlite file with no luck.
I have confirmed that enable_load_extension is true and I'm using DataGrip as my IDE. I have also quit DataGrip and rebooted to ensure any new binaries are collected. Am I missing something obvious?
As per this homebrew formula for libspatialite:
New SQLite3 extension won't load via SELECT load_extension("mod_spatialite"); unless named mod_spatialite.dylib (should actually be mod_spatialite.bundle). See: https://groups.google.com/forum/#!topic/spatialite-users/EqJAB8FYRdI
So, if installing manually, you gonna need to rename the dynamic library file as per suggested. Or you can let Homebrew do the installation for you:
brew install libspatialite
I'm trying to execute my Ruby file that just prints out a string of text: this is literally the file:
puts "System Initialized"
but I keep getting an error every time I try it.
When I execute it, it looks like this:
My-Mac-mini:event_manager my_name$ ruby lib\event_manager.rb
The error message is as follows:
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
Referenced from: /Users/crystalchoi/.rvm/rubies/ruby-2.1.3/bin/ruby
Reason: image not found
Trace/BPT trap: 5
I'm pretty new to using a Mac when it comes to programming, and I'm following a tutorial to do this, so I'm not sure what I'm doing wrong.
If anyone can help me decipher this error message and let me know how to correct it or can point me in the right direction, I would be very grateful.
ruby lib\event_manager.rb
Mac OS, like other *nix-based systems, uses / to separate the path components of files. Only Windows uses \. Instead use:
ruby lib/event_manager.rb
A Ruby tutorial isn't going to help a whole lot unless you understand the *nix command-line so you can move around and execute things, so I'd STRONGLY suggest you learn a lot more about how *nix works. Having developed on Linux for years, I have had to use my command-line knowledge just as much as my programming-language skills daily.
Does the specified library (/usr/local/lib/libgmp.10.dylib) exist?
I just checked and I could not find it at all.
GMP (libgmp) is an optional dependency of ruby. When you installed ruby, it was configured to use GMP, but you don't have the library file (/usr/local/lib/libgmp.10.dylib)
That's OK, you can get GMP ( The GNU Multiple Precision Arithmetic Library) from homebrew.
brew update
brew install gmp
You may need to re-install ruby afterward.
See https://superuser.com/questions/820364/ruby-installation-issues-with-rvm where other people had the same problem.
Advanced
If you're compiling ruby the old school way (./configure && make) then you could try using the --without-gmp config. option.
See https://bugs.ruby-lang.org/issues/8796
I am a little nervous to mess with anything in the terminal because of my small amount of experience of getting anything right on the first try. Which is why I'm asking.
I'm trying to run shp2pgsql with fresh install of OSX Mavericks. I've installed Postgres 9.3 v2.1.0-2 with PostGIS 2.1.
The error I'm getting is:
dyld: Library not loaded: #loader_path/../lib/libintl.8.dylib
Referenced from: /Library/PostgreSQL/9.3/bin/shp2pgsql
Reason: image not found
Trace/BPT trap: 5
I've looked at
http://librelist.com/browser//homebrew/2013/5/15/missing-dylib-files/#85200742c00af0a239140b02f860d987 which suggests that brew install gettext. This has installed libintl.8.dylib at:
/usr/local/Cellar/gettext/0.18.3.1/lib/libintl.8.dylib
I have found some resources on how to make symbolic (?) links, but I'm unsure if this is the appropriate solution or even how to do it in this specific case since shp2pgsql is referencing:
#loader_path/../lib/libintl.8.dylib
Thank you!
-Nicholas
The "loader" is /Library/PostgreSQL/9.3/bin/shp2pgsql. That makes dyld's notion of the #loader_path equal to /Library/PostgreSQL/9.3/bin. Substituting that into the library reference transforms #loader_path/../lib/libintl.8.dylib to /Library/PostgreSQL/9.3/bin/../lib/libintl.8.dylib. Simplifying that, we get /Library/PostgreSQL/9.3/lib/libintl.8.dylib. So that's where Postgres apparently expects its libintl library to be located.
If it's not there, that suggests the Postgres install is broken. You'd have to take that up with whoever provided it.
It's possible that you can work around this by setting a dyld environment variable. For example, you could try export DYLD_LIBRARY_PATH=/usr/local/lib before invoking Postgres. However, this will cause Postgres to use a different library than it was linked against, which isn't guaranteed to work.
You have to recompile shp2pgsql program. As you upgraded your system and libraries, you have now to recompile your program to those new libraries.
When using homebrew to install graphviz, the script gets to the point of "Making install in tkstubs" and then throws the following fatal error:
In file included from tkStubLib.c:15:
/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
I have installed XQuartz as X11 has been dropped in Mountain Lion, but I'm unsure if it is installed correctly. The location of Xlib.h is:
/opt/X11/include/X11/Xlib.h
There are also two symlinks to /opt/X11, they are:
/usr/X11
/usr/X11R6
Does this look like the correct setup to you? I've never dealt with X11 or XQuartz until yesterday.
Cheers.
After installing XQuartz you may add a symlink to your X11 installation folder by just entering
ln -s /opt/X11/include/X11 /usr/local/include/X11
in terminal. That will fix the problem as well without changing any ruby script.
You need to tell the tkstubs build (and possibly other bits in the package as well) to look for headers in /opt/X11/include; this is not on the standard include path.
Usually this is achieved by passing -I/opt/X11/include as an additional compiler flag, the method to do so is however dependent on the build system.
For reasonably modern configure scripts, the best approach is to pass it in the environment variable CPPFLAGS; if the package uses another build system or this doesn't work for another reason, then you need to look at the Makefile in the build directory.
You can enter in your shell before the compile/link (or brew) command:
export CPPFLAGS=-I/opt/X11/include
The export line will tell the compile/linker to look in /opt/X11/include for the X11 include files
Had the same issue and running this command on terminal
xcode-select --install
worked for me. Run this command after installing xQuartz.
If you need this to work in your CMake builds:
if(APPLE)
include_directories(AFTER "/opt/X11/include")
endif()
That worked well for me.
I got it to install by copying the x11 header file directory to the /opt/local/include directory. Probably not the best way to work around it but quick and easy.
I found this thread while trying to compile ffmpeg from source on OS X. I needed --enable-x11grab and the homebrew build does not support this option.
I had XQuartz installed already but I kept getting errors from ./configure: ERROR: Xlib not found. I thought the answers here would solve my problem, but they did not!
So, if anyone is ever in the same boat, my solution was this:
I opened up the generated config.log and found lots of errors referring to various includes and header files, including X11/Xlib.h - this is misleading. At the very bottom of the logfile was the key, pkg-config was complaining about looking for xbc.pc, and requested that it be put on the path. However, the error message that is displayed on the terminal says nothing about pkg-config or xbc!
The solution is to add to your PKG_CONFIG_PATH environment variable. Mine was nonexistent, so I just did export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ (the folder where I found xbc.pc).
I reran configure and everything worked like a charm!
TL;DR: check config.log - don't trust the terminal output!
Since the make file is looking for X11/xlib.h i.e., it is looking for X11 folder in the current directory, one way to solve this problem is to simply copy the /opt/X11/include/X11 directory to the directory that contains make file.