Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

1.7.12, 1.7.13: `Could not open library 'libc.dylib' : dlopen(libc.dylib, 5): image not found` in jgem with DYLD_FALLBACK_LIBRARY_PATH #1830

gabetax opened this Issue Jul 18, 2014 · 0 comments


None yet
1 participant

gabetax commented Jul 18, 2014

I first reported this issue in sstephenson/ruby-build#601. Basically, my boxen/homebrew setup on OS X 10.9.4 installs a modified java wrapper that sets DYLD_FALLBACK_LIBRARY_PATH. From /opt/boxen/bin/java:

# Invoke java with the $DYLD_LIBRARY_PATH set with the homebrew lib dir.
# This allows java to load native libraries installed via homebrew.


if [ -x /usr/libexec/java_home ]; then
  export JAVA_HOME=`/usr/libexec/java_home`

exec /usr/bin/java "$@"

When DYLD_FALLBACK_LIBRARY_PATH is setup, jgem has the following error:

~/Downloads/jruby-1.7.13/bin $ ./jgem install bundler
ERROR:  Loading command: install (LoadError)
    Could not open library 'libc.dylib' : dlopen(libc.dylib, 5): image not found
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

This error occurs using the binary 1.7.13 and 1.7.12 packages from the website. 1.7.11 and below do not seem affected. A work around is to put export DYLD_FALLBACK_LIBRARY_PATH=/usr/lib in your profile. However, it seems like this is a bug and should not need the work around, as "FALLBACK" implies that it should only be consulted if the normal search paths come up empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment