Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating 'openssl' fails on Windows #53

Closed
bxqgit opened this issue Jun 26, 2017 · 22 comments
Closed

Updating 'openssl' fails on Windows #53

bxqgit opened this issue Jun 26, 2017 · 22 comments

Comments

@bxqgit
Copy link

bxqgit commented Jun 26, 2017

I'm trying to update all the gems and the process fails on openssl gem step.

C:\>gem update openssl
Updating installed gems
Updating openssl
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions.  This could take a while...
ERROR:  Error installing openssl:
        ERROR: Failed to build gem native extension.

    current directory: C:/bin/ruby/lib/ruby/gems/2.4.0/gems/openssl-2.0.4/ext/openssl
C:/bin/ruby/bin/ruby.exe -r ./siteconf20170626-6764-ht24i.rb extconf.rb
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for -lgdi32... yes
checking for -lcrypt32... yes
checking for openssl/ssl.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/bin/ruby/bin/$(RUBY_BASE_NAME)
        --with-openssl-dir
        --without-openssl-dir
        --with-openssl-include
        --without-openssl-include=${openssl-dir}/include
        --with-openssl-lib
        --without-openssl-lib=${openssl-dir}/lib
        --with-kerberos-dir
        --without-kerberos-dir
        --with-kerberos-include
        --without-kerberos-include=${kerberos-dir}/include
        --with-kerberos-lib
        --without-kerberos-lib=${kerberos-dir}/lib
        --with-debug
        --without-debug
        --enable-debug
        --disable-debug
        --with-nsllib
        --without-nsllib
        --with-socketlib
        --without-socketlib
        --with-openssl-config
        --without-openssl-config
        --with-pkg-config
        --without-pkg-config
        --with-gdi32lib
        --without-gdi32lib
        --with-crypt32lib
        --without-crypt32lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/bin/ruby/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/openssl-2.0.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/bin/ruby/lib/ruby/gems/2.4.0/gems/openssl-2.0.4 for inspection.
Results logged to C:/bin/ruby/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/openssl-2.0.4/gem_make.out
Gems updated: openssl

Steps to reproduce

gem update openssl

What's the output from ridk version?

ruby:
  path: C:/bin/ruby
  version: 2.4.1
  platform: x64-mingw32
ruby_installer:
  package_version: 2.4.1-1
  git_commit: 6635d31
msys2:
  path: C:\bin\msys64
  title: MSYS2 64bit
  version: '20161025'
cc: x86_64-w64-mingw32-gcc (Rev3, Built by MSYS2 project) 6.3.0
sh: GNU bash, version 4.3.46(2)-release (x86_64-pc-msys)
@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

Here's the content of C:/bin/ruby/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/openssl-2.0.4/mkmf.log

=== OpenSSL for Ruby configurator ===
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/bin/ruby/lib -L. -pipe     -lx64-msvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

"x86_64-w64-mingw32-gcc -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include  -Werror=deprecated-declarations -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
/* end */

=== Checking for system dependent stuff... ===
have_library: checking for t_open() in -lnsl... -------------------- no

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/bin/ruby/lib -L. -pipe     -lx64-msvcrt-ruby240 -lnsl  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:16:57: error: 't_open' undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))t_open; return !p; }
                                                         ^~~~~~
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))t_open; return !p; }
/* end */

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/bin/ruby/lib -L. -pipe     -lx64-msvcrt-ruby240 -lnsl  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
C:/bin/msys64/MINGW64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lnsl
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: extern void t_open();
17: int t(void) { t_open(); return 0; }
/* end */

--------------------

have_library: checking for socket() in -lsocket... -------------------- no

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/bin/ruby/lib -L. -pipe     -lx64-msvcrt-ruby240 -lsocket  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
C:/bin/msys64/MINGW64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsocket
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))socket; return !p; }
/* end */

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/bin/ruby/lib -L. -pipe     -lx64-msvcrt-ruby240 -lsocket  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
conftest.c:16:13: error: conflicting types for 'socket'
 extern void socket();
             ^~~~~~
In file included from C:/bin/ruby/include/ruby-2.4.0/ruby/win32.h:41:0,
                 from C:/bin/ruby/include/ruby-2.4.0/ruby/defines.h:243,
                 from C:/bin/ruby/include/ruby-2.4.0/ruby/ruby.h:36,
                 from C:/bin/ruby/include/ruby-2.4.0/ruby.h:33,
                 from conftest.c:1:
C:/bin/msys64/MINGW64/x86_64-w64-mingw32/include/winsock2.h:1001:37: note: previous declaration of 'socket' was here
   WINSOCK_API_LINKAGE SOCKET WSAAPI socket(int af,int type,int protocol);
                                     ^~~~~~
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: extern void socket();
17: int t(void) { socket(); return 0; }
/* end */

--------------------

=== Checking for required stuff... ===
"pkg-config --exists openssl"
package configuration for openssl is not found
have_library: checking for -lgdi32... -------------------- yes

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/bin/ruby/lib -L. -pipe     -lx64-msvcrt-ruby240 -lgdi32  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: 
17: int t(void) { ; return 0; }
/* end */

--------------------

have_library: checking for -lcrypt32... -------------------- yes

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/bin/ruby/lib -L. -pipe    -lgdi32  -lx64-msvcrt-ruby240 -lcrypt32 -lgdi32  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: 
17: int t(void) { ; return 0; }
/* end */

--------------------

have_header: checking for openssl/ssl.h... -------------------- no

"x86_64-w64-mingw32-gcc -E -IC:/bin/ruby/include/ruby-2.4.0/x64-mingw32 -IC:/bin/ruby/include/ruby-2.4.0/ruby/backward -IC:/bin/ruby/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include  conftest.c -o conftest.i"
conftest.c:5:25: fatal error: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
                         ^
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <openssl/ssl.h>
/* end */

--------------------

=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above.

@MSP-Greg
Copy link
Contributor

@bxqgit

Interesting. Seems like there a few issues where some can't install gem 'x', but others can.

I just updated my 2.4.1 RI2 build to OpenSSL 2.0.4 (needed a coffee break). The only thing I have that might be non-standard is my .gemrc file, which is as follows:

--- 
:verbose: true
install: --no-document --env-shebang --platform ruby -- --use-system-libraries
update:  --no-document --env-shebang --platform ruby -- --use-system-libraries

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

So is there a way to fix this issue?

@MSP-Greg
Copy link
Contributor

@bxqgit

I assume you have an OpenSSL package installed. Check with

ridk exec pacman -Qs mingw.+openssl

If you do, you could try

gem update openssl --platform ruby -- --use-system-libraries

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

  1. ridk exec pacman -Qs mingw.+openssl runs and shows nothing. OpenSSL is installed, but it's version 1.x
  2. gem update openssl --platform ruby -- --use-system-libraries runs and gives the same result with error.

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

I think the error is somehow related to:

checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for -lgdi32... yes
checking for -lcrypt32... yes
checking for openssl/ssl.h... no

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

gem can't find:

  1. nsl
  2. socket
  3. openssl/ssl.h

Is there a way to install them?

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

I have openssl-1.0.2.k-1 and gem wants to upgrade it to version 2.0.4
I have no idea why.
msys2 says version 1.0.2.k-1 is the latest it has.

@MSP-Greg
Copy link
Contributor

@bxqgit

Actually, you could upgrade 1.0.2k to l. These version numbers refer to the MinGW OpenSSL package. They can be checked using the two constants:

OpenSSL::OPENSSL_VERSION
OpenSSL::OPENSSL_LIBRARY_VERSION

v2.0.4 is the version of the Ruby OpenSSL default gem that you want to upgrade to. It is shown in the constant OpenSSL::VERSION.

ridk exec pacman -Qs mingw.+openssl runs and shows nothing

Shows that the OpenSSL MinGW package isn't installed. Run

ridk exec pacman -S mingw-w64-x86_64-openssl

then try upgrading the gem.

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

It worked! Thank you!

gem update has run and completed without any errors.

Now I have:

ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
OpenSSL 1.0.2k 26 Jan 2017

ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
OpenSSL 1.0.2l 25 May 2017

ruby -ropenssl -e 'puts OpenSSL::VERSION'
2.0.4

Is it right that OPENSSL_LIBRARY_VERSION and OPENSSL_VERSION differ a bit?

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

  1. So next time, how do I know that mingw misses some packages? I though gem should manage all the dependencies, including mingw's.

  2. Is there any common reasonable set of mingw packages that are commonly required for Ruby/RoR development? So I could install them ahead of time.

@MSP-Greg
Copy link
Contributor

@bxqgit

Is it right that OPENSSL_LIBRARY_VERSION and OPENSSL_VERSION differ a bit?

Sort of, maybe. It means Ruby OpenSSL was compiled with a different version of the package than the version of the dll's that it's loading. OpenSSL 1.0.2l probably has some bug fixes in it (compared to 1.0.2k), but I haven't checked, and sometimes the updates are for CVE's...

I'm not sure if this is an issue that's been considered. OpenSSL is what is called a 'default gem', and the Ruby team has been converting existing std-lib items to default gems, and also updating them. I'll open an issue for discussion...

Things should work as is, but the fix involves copying two files and a folder from your msys64 folder to your ruby folder. I'll get that info to you tonite (I'm -0500 from GMT)

  1. So next time, how do I know that mingw misses some packages? I though gem should manage all the dependencies, including mingw's.

First of all, see For gem developers. @larskanis set that up so people installing gems wouldn't need to be concerned. But this is very new, so not a lot of gems have implemented it. Also, some of this is due to the fact that many gems were available in pre-compiled MinGW format weren't compatible with Ruby 2.4. And on and on.

  1. Is there any common reasonable set of mingw packages that are commonly required for Ruby/RoR development? So I could install them ahead of time.

At some point, that may be included here, or at least a script / cmd file for doing so. I think people would prefer that, rather than the OneClick/RubyInstaller group keeping track of it, the gem authors / RoR group should address what's required for Windows installs. Also, bear in mind that almost everything is open source, so at any point in time, various gem 'groups' may not even have an active member using Windows.

@bxqgit
Copy link
Author

bxqgit commented Jun 26, 2017

@MSP-Greg

Thank you for the detailed explanation. I've already seen somewhere that Windows is not the best platform for Ruby/RoR development. I'm coming from Java world, where Windows is totally fine for a developer's workstation. it's also obvious, I don't want to deal with compatibility problems, missing dependencies and other awkward issues in the future, while exploring Ruby/RoR.

So which platform is the most "native" for Ruby/RoR development?
Linux or macOS?
What platform does the majority of Ruby/RoR developers use for everyday development?

@larskanis
Copy link
Member

The openssl DLLs are shipped with rubyinstaller and are always preferred to any other non system DLLs. Therefore the only way to activate the OpenSSL version 1.0.2l is to copy the files into rubies dll directory.

So to summarize, the installation procedure for the openssl gem should be as following:

ridk enable
pacman -S mingw-w64-x86_64-openssl
gem install openssl
cp c:/msys64/mingw64/bin/libeay32.dll c:/msys64/mingw64/bin/ssleay32.dll c:/Ruby24-x64/bin/ruby_builtin_dlls/
ruby -ropenssl -e "puts OpenSSL::OPENSSL_LIBRARY_VERSION"
# => OpenSSL 1.0.2l  25 May 2017

@bxqgit You can pick Linux or macOS. Whatever you prefer. Windows is often a bit more difficult, so that if you need to do rails development only, it's often better to switch to another OS. Most things will work on Windows after some investigation, but instructions and stackoverflow articles often lack Windows specifics.

@bxqgit
Copy link
Author

bxqgit commented Jun 27, 2017

@larskanis

Thank you, it worked. Now it's 'OpenSSL 1.0.2l' for both vars.

I guess Linux should be better suited for Ruby/RoR development, cause in most cases it's a target production environment.

@MSP-Greg
Copy link
Contributor

@larskanis

Thanks for responding, I was meaning to check whether a 'OpenSSL engines' folder also needed copying.

It does bring up the issue with dll's used by default ext gems, and whether RubyGems / RI2 should be copying any updated package dll's into the bin/ruby_builtin_dlls folder when a default ext gem is updated.

Might be kind of messy, but (obviously) RI2 has a list of the required dll's...

@larskanis
Copy link
Member

@MSP-Greg The only reliable way to update the bundled DLLs is by installing a new RubyInstaller version, IMHO. I'll release a new version at the weekend.

@bxqgit
Copy link
Author

bxqgit commented Jun 27, 2017

@larskanis @MSP-Greg

By the way. What's the recommended way to update RubyInstaller? Is there a shell command for that matter? Or do I have to download and run rubyinstaller.exe and it will update everything?

@MSP-Greg
Copy link
Contributor

@larskanis

The only reliable way to update the bundled DLLs

Well, I did say messy...

As you know, with Ruby Core moving towards using more bundled & default gems, issues with bundled dll's and users performing gem update may become more common. It's a reasonable thing for most users to do...

As an aside, do you know if RubyGems has any hooks so that it can perform a callback (with a gem name) when an ext gem is installed / updated?

@larskanis
Copy link
Member

@bxqgit You have to download and run rubyinstaller.exe to update everything. You can optionally de-install the old rubyinstaller version first - it will not remove any installed gems, but only RubyInstaller files - but this is optionally.
This works for patch level updates like 2.4.2-1 over 2.4.1-1. But don't install major or minor ruby updates like 2.5 over 2.4 - this will not work!

@MSP-Greg

do you know if RubyGems has any hooks so that it can perform a callback

We already use such a hook: https://github.com/oneclick/rubyinstaller2/blob/master/resources/files/operating_system.rb

I'll release RubyInstaller-2.4.1-2 soon, which updates OpenSSL, so that I close this ticket now.

larskanis added a commit to larskanis/openssl that referenced this issue Jul 26, 2017
RubyInstaller2 supports metadata tags for installation of dependent
MSYS2/MINGW libraries. The openssl gem requires the mingw-openssl
package to be installed on the system, which the gem installer takes
care about, when this tag is set.

The feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This fixes issues like 
oneclick/rubyinstaller2#54 and 
oneclick/rubyinstaller2#53 .
rhenium pushed a commit to larskanis/openssl that referenced this issue Jul 27, 2017
RubyInstaller2 supports metadata tags for installation of dependent
MSYS2/MINGW libraries. The openssl gem requires the mingw-openssl
package to be installed on the system, which the gem installer takes
care about, when this tag is set.

The feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This fixes issues like
oneclick/rubyinstaller2#54 and
oneclick/rubyinstaller2#53 .
@larskanis
Copy link
Member

@MSP-Greg Thank you for your great support and tracking the issue down! Regarding the build/runtime version mismatch I opened #60 .

@ivanromakh
Copy link

@larskanis Thanks.
This helped me even now your instructions are for centuries:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants