Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
[windows][jruby-complete] Resolv.getaddress fails #580
Executing the following on windows
fails with this stacktrace
It seems similar to old closed report JRUBY-3480
So the issue here is that resolv.rb inludes the following code in its init logic:
class Hosts if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM require 'win32/resolv' DefaultFileName = Win32::Resolv.get_hosts_path else DefaultFileName = '/etc/hosts' end
On JRuby, RUBY_PLATFORM is always 'java', so this attempts to look for the wrong hosts file.
It does appear that Win32::Resolv.get_hosts_path works on current JRuby:
I will modify resolv.rb to use RbConfig's "host_os" for this check rather than RUBY_PLATFORM.