Find out which gems require native c extensions from a Gemfile?

别来无恙 提交于 2019-12-03 06:46:06

You can use JRuby Lint for that. It will will check for some gems requiring C extension and even list alternative (based on this list).

user3592693

Based on the fact that gems with native extensions usually have an /ext directory, I made a simple oneliner that finds these gems:

puts `bundle show --paths`.split("\n").select{|dep| File.directory?("#{dep}/ext") }.map{|dep| dep.split('/').last }.join(', ')

You can do this on the command line with this command:

$ bundle show --paths | ruby -e "STDIN.each_line {|dep| puts dep.split('/').last if File.directory?(File.join(dep.chomp, 'ext')) }"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!