Skip to content
Browse files

Check for installed devkit after upgrade

Closes #151
  • Loading branch information...
1 parent f80d869 commit 688b690bdbd65dd875e08a83e4ae743948bc4a42 @Azolo Azolo committed
Showing with 9 additions and 5 deletions.
  1. +9 −5 resources/rubygems/operating_system.rb
View
14 resources/rubygems/operating_system.rb
@@ -1,18 +1,22 @@
# :DK-BEG: missing DevKit/build tool convenience notice
Gem.pre_install do |gem_installer|
unless gem_installer.spec.extensions.empty?
- have_tools = %w{gcc make sh}.all? do |t|
- system("#{t} --version > NUL 2>&1")
- end
+ begin
+ load 'devkit'
+ rescue LoadError
+ have_tools = %w{gcc make sh}.all? do |t|
+ system("#{t} --version > NUL 2>&1")
+ end
- unless have_tools
- raise Gem::InstallError,<<-EOT
+ unless have_tools
+ raise Gem::InstallError,<<-EOT
The '#{gem_installer.spec.name}' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
EOT
+ end
end
end
end

0 comments on commit 688b690

Please sign in to comment.
Something went wrong with that request. Please try again.