Skip to content

Instantly share code, notes, and snippets.

@tsnow
Created April 22, 2012 22:49
Show Gist options
  • Save tsnow/2467382 to your computer and use it in GitHub Desktop.
Save tsnow/2467382 to your computer and use it in GitHub Desktop.
Reinstall all gems with extensions
for j in `gem list | awk '{ print $1 }'`; do
gem specification $j |
ruby -ryaml -e 'b=YAML::load(ARGF); a=b.instance_variable_get(:@ivars)["extensions"]; puts a if !a.empty?; exit (!a.empty? ? 0 : 1)' &&
gem pristine $j;
done
@tsnow
Copy link
Author

tsnow commented Oct 28, 2013

Determine the native extension gems for a Gemfile.lock.

bundle exec ruby -e 'puts Gem.loaded_specs.values.select{|i| !i.extensions.empty?}.map{|i| i.name}'
> gem --version
1.8.25
> bundle --version
Bundler version 1.3.5
> ruby --version
ruby 1.9.3p393 (2013-02-26) [x86_64-darwin12.2.0]
rgeo
json
kgio
pg
raindrops
unicorn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment