Created
August 14, 2023 01:40
-
-
Save keiya/1f2ec624a7e5f775283ad28b4a270c4d to your computer and use it in GitHub Desktop.
This Ruby script lists all gems in the current project that contain native extensions. This is useful for diagnosing extension-related issues and assessing project compatibility across different environments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# typed: false | |
require 'bundler' | |
gems = Bundler.load.specs.map(&:name) | |
extensions = gems.map do |gem| | |
spec = Gem::Specification.find_by_name(gem) | |
{ name: gem, extensions: spec.extensions } | |
end | |
extensions.each do |extension| | |
if extension[:extensions].any? | |
p extension | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment