Skip to content

Instantly share code, notes, and snippets.

@Azolo
Created April 14, 2012 15:19
Show Gist options
  • Save Azolo/2385177 to your computer and use it in GitHub Desktop.
Save Azolo/2385177 to your computer and use it in GitHub Desktop.
Why require causes Gem.pre_install to fail
irb(main):001:0> require 'devkit'
Temporarily enhancing PATH to include DevKit...
=> true
irb(main):002:0> require 'devkit'
=> false
PS C:\Users\Justin\Projects\Ruby\test> gem i rdiscount json
ERROR: Error installing rdiscount:
pre-install hook at C:/SDK/Ruby/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/defaults/operating_system.
rb:2 failed for rdiscount-1.6.8
ERROR: Error installing json:
pre-install hook at C:/SDK/Ruby/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/defaults/operating_system.
rb:2 failed for json-1.6.6
# :DK-BEG: override 'gem install' to enable RubyInstaller DevKit usage
Gem.pre_install do |gem_installer|
unless gem_installer.spec.extensions.empty?
false
end
end
# :DK-END:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment