How do I get a list of gems that are installed that have native extensions?

后端 未结 5 948
梦谈多话
梦谈多话 2021-01-01 21:05

I\'m on windows, and have updated from ruby 1.8.x to 1.9.x, and am now getting error popups that complain ruby-mssomethingrt.1.8.x.dll is missing.

I would like to fi

5条回答
  •  没有蜡笔的小新
    2021-01-01 21:32

    A good start would be to look at the gem specification for each gem and see if it has the extensions field set. That should leave you with a short-list of gems to re-install. They don't necessarily all use native extensions, but if you look at the corresponding extconf.rb files, this should be pretty easy to find out.

    Update: Here is a short ruby script to list those gems:

    require 'rubygems'
    
    Gem.source_index.each do |gem|
      spec =  Gem.source_index.specification(gem[0])
      ext = spec.extensions
      puts "#{gem[0]} has extensions: #{ext}" unless ext.empty?
    end
    

提交回复
热议问题