--- lib/pkgmisc.rb.orig 2011-06-12 17:45:04.000000000 +0000 +++ lib/pkgmisc.rb 2011-06-12 17:45:11.000000000 +0000 @@ -107,17 +107,21 @@ module LIBC PATH_MAX = 1024 - extend DL::Importable + begin + extend DL::Importable + rescue NameError + extend DL::Importer # Ruby 1.9 use this + end dlload "libc.so" extern "const char *realpath(char *, char *)" end - def File.realpath(path) + def realpath(path) return LIBC.realpath(path, "\0" * LIBC::PATH_MAX) || File.expand_path(path) end rescue LoadError, RuntimeError - def File.realpath(path) + def realpath(path) return File.expand_path(path) end end