Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@skull-squadron
Copy link

@skull-squadron skull-squadron commented May 16, 2023

Here's a quick hack for the ~ 1.15.x series for posterity. It's good that it was eventually refactored.

                  # TODO better library lookup logic
                  unless libname.start_with?("/") || FFI::Platform.windows?
+                   dirs  = ENV.fetch('DYLD_LIBRARY_PATH',          '').split(':').map { |part| part+'/' }
+                   dirs += ENV.fetch('DYLD_FALLBACK_LIBRARY_PATH', '').split(':').map { |part| part+'/' }
+                   dirs += ['/usr/lib/','/usr/local/lib/','/opt/local/lib/', '/opt/homebrew/lib/']
+                   path = dirs.find do |pth|
-                   path = ['/usr/lib/','/usr/local/lib/','/opt/local/lib/', '/opt/homebrew/lib/'].find do |pth|
                      File.exist?(pth + libname)
                    end

@larskanis
Copy link
Member

This is solved by #1088 .

@larskanis larskanis closed this Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants