如何解决在 Windows 上使用 Rails 找不到的“libcurl" [英] How to solve 'libcurl' not found with Rails on Windows
本文介绍了如何解决在 Windows 上使用 Rails 找不到的“libcurl"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这让我很头疼.我正在继续一个在 Linux 上启动的 Rails 项目,当我在 Ruby Mine 上运行 Puma 时,我一直得到这个:
This is giving me a headache. I'm continuing a Rails project that started on Linux and I keep getting this when I run Puma on Ruby Mine:
Error:[rake --tasks] DL is deprecated, please use Fiddle
rake aborted!
LoadError: Could not open library 'libcurl': The specified module could not be found.
Could not open library 'libcurl.dll': The specified module could not be found.
Could not open library 'libcurl.so.4': The specified module could not be found.
Could not open library 'libcurl.so.4.dll': The specified module could not be found.
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/ffi-1.9.14-x86-mingw32/lib/ffi/library.rb:147:in `block in ffi_lib'
[...]
现在,我尝试了什么?
- 我按照以下步骤在Windows上成功安装了Puma
- 我下载了
curl-7.50.1-win32-mingw
并将其放在C:/curl"上 - 我将 C:/curl/bin 和 C:/curl/include 添加到 PATH
- 我用
gem install curb --platform=ruby -- --with-curl-lib=C:/curl/bin --with-curl-include=C:/curl/include 成功安装了curb gem
- 我将 .dll 文件放在 Ruby bin 文件夹中,将证书安装在 curl/bin 中,甚至运行 curl.exe 以防万一.
- I installed Puma successfully on Windows following this steps
- I downloaded
curl-7.50.1-win32-mingw
and put it on "C:/curl" - I added C:/curl/bin and C:/curl/include to PATH
- I installed successfully curb gem with
gem install curb --platform=ruby -- --with-curl-lib=C:/curl/bin --with-curl-include=C:/curl/include
- I put the .dll files in Ruby bin folder, installed the certificate in curl/bin and even run the curl.exe just in case.
我重新启动了机器,但我一直看到同样的错误.
I rebooted the machine but I keep seeing the same error.
我不知道该怎么办.如何在 Windows 上成功安装 libcurl 以与 Rails 一起使用
推荐答案
对我有用的答案 (W10/Ruby2.6.0) 是:
Answer that worked for me (W10/Ruby2.6.0) was:
- 从以下 URL 下载 cURL:https://curl.haxx.se/windows/(我选择 64 位,因为这是我使用的系统)
- 进入存档并浏览到
/bin
- 找到
libcurl_x64.dll
(可能只是libcurl.dll
) - 解压到本地驱动器
- 如果它有
_x64
后缀,请将其重命名为libcurl.dll
- 将文件剪切并粘贴到 Ruby 安装的
/bin
目录中
- Download cURL from the following URL: https://curl.haxx.se/windows/ (I chose 64bit because that's the system I'm using)
- Go into the archive and browse to
/bin
- Locate
libcurl_x64.dll
(it may be justlibcurl.dll
) - Extract to your local drive
- Rename it to
libcurl.dll
if it has the_x64
suffix - Cut + paste the file into the
/bin
directory of your Ruby installation
这篇关于如何解决在 Windows 上使用 Rails 找不到的“libcurl"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文