lib/phusion_passenger/dependencies.rb in passenger-3.0.9 vs lib/phusion_passenger/dependencies.rb in passenger-3.0.10
- old
+ new
@@ -222,10 +222,15 @@
dep.name = "Ruby development headers"
dep.define_checker do |result|
require 'rbconfig'
begin
require 'mkmf'
- header_dir = Config::CONFIG['rubyhdrdir'] || Config::CONFIG['archdir']
+ if defined?(::RbConfig)
+ config = ::RbConfig::CONFIG
+ else
+ config = ::Config::CONFIG
+ end
+ header_dir = config['rubyhdrdir'] || config['archdir']
result.found(File.exist?("#{header_dir}/ruby.h"))
rescue LoadError, SystemExit
# On RedHat/Fedora/CentOS, if ruby-devel is not installed then
# mkmf.rb will print an error and call 'exit'. So here we
# catch SystemExit.