Open glasissnake opened 3 years ago
I've got the same problem, trying to crawl through a webpage with watir but got the openssl.so LoadError. Tried every option like gem-full and all ruby core but to no avail
When i launch script directly it works ok but not when it's the exe created by ocra
Ruby 2.7.2 windows 10 1803
This took me also a few hours to resolve. I had to add
--dll ruby_builtin_dlls\libssl-1_1-x64.dll
to resolve LoadError on .../x64-mingw32/openssl.so
(https functionality)
--dll ruby_builtin_dlls\libyaml-0-2.dll
to resolve LoadError on .../x64-mingw32/psych.so
(for working with yaml)
I have no idea how it is possible to map the various '.so' libraries from mingw to the ruby builtin dlls. I ended up in guestimating the correct ones for each LoadError.
Use optional command to include all ruby_builtin_dlls so it doesn't confuse me.
ocra example.rb --output example.exe --dll ruby_builtin_dlls\*.dll
Depending on the SSL gem, you might also need to add --dll ruby_builtin_dlls\libcrypto-1_1-x64.dll if you are getting openssl.so errors
@roboyeti thank you! That fixed the openssl.so load error for me, however now I have an error telling me that it is "unable to get local issuer certificate". Any ideas?
@roboyeti thank you! That fixed the openssl.so load error for me, however now I have an error telling me that it is "unable to get local issuer certificate". Any ideas? !
I was looking at ruby packer and it has a default option for openssl cert directory to use, leading me to believe that is probably the direct to look into. Don't know yet where that is expected in Windows. https://github.com/pmq20/ruby-packer#the---openssl-dir-option
@Coding-Cactus maybe try putting your pem into
PS C:\Users\roboy\wth> irb irb(main):001:0> require 'openssl' irb(main):002:0> OpenSSL::X509::DEFAULT_CERT_DIR => "C:/Ruby30-x64/ssl/certs" irb(main):003:0> OpenSSL::X509::DEFAULT_CERT_FILE => "C:/Ruby30-x64/ssl/cert.pem" irb(main):004:0>
Also, the ENV var, SSL_CERT_FILE & SSL_CERT_DIR should provide openssl with a clue where to look for certs.
Let me know if any of that helps, since I will be running into the same issue not far down the road.
@roboyeti same error unfortunately 😢
Oh ... maybe try adding the ssl cert directory to ocra...? --gem-file
As far as the ruby in the exe is concerned, the original ruby install dir doesn't exist, so openssl has no idea where the certs are. Not sure if that will work, but suspect that might be the problem.
Yay adding --gem-file C:\Ruby30-x64\ssl
fixes it. Thank you so much!
@Coding-Cactus Awesome! I am so glad to hear that it worked for you and thank you for testing it, so now I know it will work for me!
So i was trying to build a standalone .exe from my ruby script with ocra:
When i try to build the executable with ocra using the command
ocra --dll ruby_builtin_dlls\libssp-0.dll --console --no-autoload --add-all-core test.rb
i get following output:Ocra tells me that the executable has been created Successfully, but when i try to execute it i get this output:
I am very confused because i cannot pin down the problem. It seems that it cannot load net-ssh(https://github.com/net-ssh/net-ssh) and openssl.so(?), but why?
i am on Windows 10, installed Ruby using the RubyInstaller. and installed the gems with
gem install ocra
andgem install net-ssh
. The Program runs fine when executed with the Ruby interpreter. I tried it on two different Machines with fresh Ruby Installments with no Success. I've tried various ocra build commands, all resulting in the same error.Maybe someone here can help me and tell me what i am doing wrong?