summaryrefslogtreecommitdiff
path: root/lib/bundler/cli
diff options
context:
space:
mode:
authorVyacheslav Alexeev <alexeev.corp@gmail.com>2022-01-11 23:38:32 +0800
committergit <svn-admin@ruby-lang.org>2022-01-13 18:16:05 +0900
commitd0a063794873eafed413957cb7ab93279945258a (patch)
tree5d32e4f70217b84f08e03ca80283197c499f8f3f /lib/bundler/cli
parent9828502570acce53f4094c23756bc82bd256eab7 (diff)
[rubygems/rubygems] Use `Fiddle` in `bundle doctor` to check for dynamic library presence
https://github.com/rubygems/rubygems/commit/ecd495ce1b
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r--lib/bundler/cli/doctor.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/cli/doctor.rb b/lib/bundler/cli/doctor.rb
index 43f1ca92e2..74444ad0ce 100644
--- a/lib/bundler/cli/doctor.rb
+++ b/lib/bundler/cli/doctor.rb
@@ -2,6 +2,7 @@
require "rbconfig"
require "shellwords"
+require "fiddle"
module Bundler
class CLI::Doctor
@@ -71,7 +72,14 @@ module Bundler
definition.specs.each do |spec|
bundles_for_gem(spec).each do |bundle|
- bad_paths = dylibs(bundle).select {|f| !File.exist?(f) }
+ bad_paths = dylibs(bundle).select do |f|
+ begin
+ Fiddle.dlopen(f)
+ false
+ rescue Fiddle::DLError
+ true
+ end
+ end
if bad_paths.any?
broken_links[spec] ||= []
broken_links[spec].concat(bad_paths)