From: casper.cg@... Date: 2018-09-10T19:18:37+00:00 Subject: [ruby-core:88937] [Ruby trunk Bug#15097] Gem install fails on Ruby 2.5.1 with Cygwin (get_dns_server_list undefined) Issue #15097 has been updated by caspercg (Casper G). nobu (Nobuyoshi Nakada) wrote: > I can't reproduce it, with the trunk and 2.5.2 in the repository, using Thanks for taking a look at it. This is on a 32-bit Windows, if that has any significance? However I now figured out a workaround and got it to work. **1:** `ext/win32/resolv/extconf.rb` has to be modified like so: ~~~ ruby # if have_library('iphlpapi', 'GetNetworkParams') create_makefile('win32/resolv') # end ~~~ I.e. the test for GetNetworkParams has to be commented out, because this is the test that starts all the trouble. **2:** Once `ext/win32/resolv/Makefile` has been generated then `-liphlpapi` has to be manually added to the `LIBS` line in the Makefile. Now everything compiles, and the resolver works as it should. **3:** However there is one more thing which needs to be done, and that is a full Cygwin rebase of the Ruby dynamic link libraries, otherwise you will get a lot of errors like this: ~~~ ruby 9876 child_info_fork::abort: address space needed by 'utf_16be.so' (0x270000) is already occupied ~~~ For anyone else running into this issue follow the instructions for rebasing here: https://github.com/rvm/rvm/issues/3309 And here: http://cygwin.wikia.com/wiki/Rebaseall After these 3 steps are done, I now have it fully working. I think there is something wrong with the 32-bit detection of GetNetworkParams(?), also it seems there's a missing rebase at the end of the installation. In any case, with the above tricks, it works fine now. ---------------------------------------- Bug #15097: Gem install fails on Ruby 2.5.1 with Cygwin (get_dns_server_list undefined) https://bugs.ruby-lang.org/issues/15097#change-73971 * Author: caspercg (Casper G) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [i386-cygwin] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- Compiled and installed Ruby 2.5.1 on Cygwin, and now gem install fails with: ~~~ ruby ERROR: While executing gem ... (NameError) undefined local variable or method `get_dns_server_list' for Win32::Resolv:Module ~~~ While building Ruby I got the following warning: ~~~ ruby win32/resolv: Could not be configured. It will not be installed. Check ext/win32/resolv/mkmf.log for more details. ~~~ The error in mkmf.log is: ~~~ ruby /ruby-2.5.1/ext/win32/resolv/conftest.c:14: undefined reference to `GetNetworkParams' collect2: error: ld returned 1 exit status ~~~ The mkmf.log is also attached. Could not figure out how to fix this problem. Is 2.5.1 not compatible with Cygwin? ---Files-------------------------------- mkmf.log (3.96 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: