diff --git a/ext/mpi/extconf.rb b/ext/mpi/extconf.rb index 03eff3a..4320394 100644 --- a/ext/mpi/extconf.rb +++ b/ext/mpi/extconf.rb @@ -4,12 +4,20 @@ gem_path = nil begin require "rubygems" - if (spec = Gem.source_index.find_name("narray")).any? - gem_path = spec.last.full_gem_path + if Gem::Specification.respond_to?(:find_by_name) + if spec = Gem::Specification.find_by_name("narray") + gem_path = spec.full_gem_path + end + else + if (spec = Gem.source_index.find_name("narray")).any? + gem_path = spec.full_gem_path + end end rescue LoadError dir_config("narray", Config::CONFIG["sitearchdir"]) end -find_header("narray.h", File.join(gem_path,"src")) +unless find_header("narray.h", gem_path) + find_header("narray.h", File.join(gem_path,"src")) +end create_makefile("mpi")