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

Ruby-win64 support with libcurl-x64.dll #230

Open
wutai3 opened this issue Apr 8, 2023 · 3 comments
Open

Ruby-win64 support with libcurl-x64.dll #230

wutai3 opened this issue Apr 8, 2023 · 3 comments

Comments

@wutai3
Copy link

wutai3 commented Apr 8, 2023

Hi, I use typhoeus for ruby-win64 enviroment.

Because curl-x64 official dll is "libcurl-x64.dll", so DLL load have failed. https://curl.se/windows/

D:\>ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]

D:\>ruby -e " require 'typhoeus'  "
D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ffi-1.15.5-x64-mingw-ucrt/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library 'libcurl': �w�肳�ꂽ���W���[����������܂���B\r (LoadError)
.
Could not open library 'libcurl.dll': �w�肳�ꂽ���W���[����������܂���B\r
.
Could not open library 'libcurl.so.4': �w�肳�ꂽ���W���[����������܂���B\r
.
Could not open library 'libcurl.so.4.dll': �w�肳�ꂽ���W���[����������܂���B\r
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ffi-1.15.5-x64-mingw-ucrt/lib/ffi/library.rb:99:in `map'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ffi-1.15.5-x64-mingw-ucrt/lib/ffi/library.rb:99:in `ffi_lib'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon/curls/settings.rb:10:in `<module:Curl>'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon/curls/settings.rb:3:in `<module:Ethon>'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon/curls/settings.rb:2:in `<top (required)>'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon/curl.rb:28:in `require'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon/curl.rb:28:in `<module:Curl>'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon/curl.rb:14:in `<module:Ethon>'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon/curl.rb:9:in `<top (required)>'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon.rb:16:in `require'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/ethon-0.16.0/lib/ethon.rb:16:in `<top (required)>'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `require'
        from D:/pkg/ruby/lib/ruby/gems/3.1.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
        from -e:1:in `require'
        from -e:1:in `<main>'

Could it change setting file below?

ethon/curls/settings.rb 

-   ffi_lib ['libcurl', 'libcurl.so.4']
+    ffi_lib ['libcurl', 'libcurl.so.4', 'libcurl-x64']

Thanks.

@eye942
Copy link

eye942 commented Apr 12, 2023

Does your suggested change work for you?

For me, it looks like adding an entry for libcurl-4 worked for me.
image

However, I'm using msys2's ucrt version of curl via ridk on Windows 10.

@wutai3
Copy link
Author

wutai3 commented Apr 13, 2023

Oh, its site advised to download official 'libcurl.dll' file..
https://rastating.github.io/fixing-issues-in-typhoeus-and-httparty-on-windows/
https://stackoverflow.com/questions/22525093/typhoeus-windows-installation

I used its way and it works.

@wutai3
Copy link
Author

wutai3 commented Apr 15, 2023

Hi, but "libcurl-x64.dll" way also works. Which is pefer better?

  • ffi_lib ['libcurl', 'libcurl.so.4', 'libcurl-x64']

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

2 participants