-
Notifications
You must be signed in to change notification settings - Fork 256
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
Comments
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
|
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:
|
So is there a way to fix this issue? |
I assume you have an OpenSSL package installed. Check with
If you do, you could try
|
|
I think the error is somehow related to:
|
gem can't find:
Is there a way to install them? |
I have openssl-1.0.2.k-1 and gem wants to upgrade it to version 2.0.4 |
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:
v2.0.4 is the version of the Ruby OpenSSL default gem that you want to upgrade to. It is shown in the constant
Shows that the OpenSSL MinGW package isn't installed. Run
then try upgrading the gem. |
It worked! Thank you!
Now I have: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION' ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' ruby -ropenssl -e 'puts OpenSSL::VERSION' 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)
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.
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. |
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? |
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. |
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. |
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... |
@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. |
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? |
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 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? |
@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.
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. |
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 .
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 Thanks. |
I'm trying to update all the gems and the process fails on openssl gem step.
Steps to reproduce
gem update openssl
What's the output from
ridk version
?The text was updated successfully, but these errors were encountered: