After updating homebrew (this example Feb 2022), if you try running mvim from the terminal you may get (paths may vary):
dyld[87017]: Library not loaded: /opt/homebrew/opt/ruby/lib/libruby.3.0.dylib
Referenced from: /Applications/MacVim.app/Contents/MacOS/Vim
Reason: tried: '/opt/homebrew/opt/ruby/lib/libruby.3.0.dylib' (no such file), '/usr/local/lib/libruby.3.0.dylib' (no such file), '/usr/lib/libruby.3.0.dylib' (no such file), '/opt/homebrew/Cellar/ruby/3.1.0/lib/libruby.3.0.dylib' (no such file), '/usr/local/lib/libruby.3.0.dylib' (no such file), '/usr/lib/libruby.3.0.dylib' (no such file)
[1] 87017 abort /Applications/MacVim.app/Contents/MacOS/Vim
You will see that homebrew ruby is now updated to 3.1. Reinstalling macvim and ruby doesnt help. For now, you can fix with something like (your paths will need to take into account the location of your home directory and an install of ruby3.0):
ln -s /Users/<USER>/.rvm/rubies/ruby-3.0.3/lib/libruby.3.0.dylib /usr/local/lib/libruby.3.0.dylib
There is also a ruby#3.0 package available under homebrew if you arent using rvm or similar.
I dont know if there is a better fix for this yet.
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 am trying to install gaia, image software for astronomy. I am running Snow Leopard 10.6.8 and have xcode tools 3.2.6 with developer tools installed. I also believe I have the correct gfortran compiler necessary.
How do I install gaia now? What are the commands I need to run. When I download it, it unzips and there are just a bunch of folders.
Any help is greatly appreciated.
Thanks,
Max
Steps for installing Starlink Gaia
Download the latest Starlink distribution (Hikianalia, as of this writing):
http://starlink.jach.hawaii.edu/starlink/HikianaliaDownload
Uncompress the .tar.gz. A new star directory will be created. You can move it some other place (for instance, /Users/Shared/star, or /star)
As the installer is 0.7GB, you might want to delete it after installation has been successful.
Depending on your default shell:
For C (csh, tcsh) shells:
Create a STARLINK_DIR environment variable pointing to where the star directory is to be left (i.e., /Users/Shared/star):
setenv STARLINK_DIR /Users/Shared/star
Source the chsrc files
source $STARLINK_DIR/etc/login
source $STARLINK_DIR/etc/cshrc
You can combine the steps above creating an alias called start_starlink to add to your .cshrc file, so that you only start the Starlink libraries when needed:
alias start_starlink 'setenv STARLINK_DIR /Users/Shared/star; source $STARLINK_DIR/etc/login; source $STARLINK_DIR/etc/cshrc'
For Bourne (sh, bash, zsh) shells:
Create a STARLINK_DIR environment variable pointing to where the star directory is to be left (i.e., /Users/Shared/star):
export STARLINK_DIR=/Users/Shared/star
Source the chsrc files
. $STARLINK_DIR/etc/profile
You can combine the steps above creating an alias called start_starlink to add to your .cshrc file, so that you only start the Starlink libraries when needed:
alias start_starlink='export STARLINK_DIR=/Users/Shared/star; . $STARLINK_DIR/etc/profile'
So, after typing start_starlink, you can just type gaia to launch Starlink Gaia.
Fixing a missing gfortran
In x86_64 systems, if launching gaia fails with the message:
dyld: Library not loaded: /usr/local/lib/libgfortran.3.dylib
Referenced from: /Users/jdsant/Downloads/star/bin/gaia/gaia_wish
Reason: image not found
you need to make sure that you have gfortran libraries installed, and that they are were gaia expects them.
You can try to use locate libgfortran.3.dylib, and copy it to /usr/local/lib , or make a symlink to it. See, for instance, http://starlink.jach.hawaii.edu/starlink/HikianaliaDownload#SnowLeopard64-bitdistribution
I had this
dyld: Library not loaded: /usr/local/lib/libgfortran.3.dylib
Referenced from: /Users/jdsant/Downloads/star/bin/gaia/gaia_wish
Reason: image not found
problem and was becoming very frustrated until I figured out that per the instructions on the GFortran website, that you must unzip the gcc file in the terminal, not using your browser. So, after downloading gcc-5.0-bin.tar.gz, I executed:
$ gunzip gcc-5.0-bin.tar.gz
$ sudo tar -xvf gcc-5.0-bin.tar -C /
this unpacked the file, but then received a very long error stating "Application initialization failed: no display name and no $DISPLAY environment variable" and "gaia was not properly installed". I then executed:
$ startx
which started X11, and then opened xterm. I then restated in xterm:
$ export STARLINK_DIR=/Users/kristen/Downloads/star-2014A
$ source $STARLINK_DIR/etc/profile
$ gaia &
and another GUI for GAIA Starlink popped up and it all worked
I'm using rvm on ubunut 13.04. Today I updated ruby with latest 1.9.3 version.
Now, when I try to start vim I get:
vim: error while loading shared libraries: libruby.so.1.9: cannot open shared object file: No such file or directory.
ldd $(which vim) | grep ruby gives libruby.so.1.9 => not found
Any idea how to fix it?
The Vim binaries are compiled against a particular Ruby (, Python, Perl, etc.) version. If that version vanishes, the integration is broken.
You can try to put back the required library with a link (something like libruby.so.1.9 -> libruby.so.1.9.3). If that fails, you have to find a corresponding Vim version or compile Vim yourself.
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.