gpt4 book ai didi

ruby-on-rails - 如何解决 'libcurl' not found with Rails on Windows

转载 作者:可可西里 更新时间:2023-11-01 12:19:19 28 4
gpt4 key购买 nike

这让我很头疼。我正在继续一个在 Linux 上启动的 Rails 项目,当我在 Ruby Mine 上运行 Puma 时,我不断得到这个:

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'
[...]

现在,我尝试了什么?

  • 我按照 this steps 在 Windows 上成功安装了 Puma
  • 我下载了 curl-7.50.1-win32-mingw 并将其放在“C:/curl”上
  • 我在 PATH 中添加了 C:/curl/bin 和 C:/curl/include
  • 我使用 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 以防万一。

我重新启动了机器,但我一直看到同样的错误。

我不知道该怎么办。 如何在 Windows 上成功安装 libcurl 以与 Rails 一起使用

最佳答案

对我有用的答案 (W10/Ruby2.6.0) 是:

  1. 从以下 URL 下载 cURL:https://curl.haxx.se/windows/ (我选择 64 位,因为这是我正在使用的系统)
  2. 进入存档并浏览到 /bin
  3. 找到libcurl_x64.dll(它可能只是libcurl.dll)
  4. 解压缩到您的本地驱动器
  5. 如果它有 _x64 后缀,则将其重命名为 libcurl.dll
  6. 将文件剪切并粘贴到 Ruby 安装的 /bin 目录中

关于ruby-on-rails - 如何解决 'libcurl' not found with Rails on Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39377541/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com