如何解决Windows上Rails找不到的'libcurl' [英] How to solve 'libcurl' not found with Rails on Windows

查看:297
本文介绍了如何解决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'
[...]

现在,我尝试了什么?

  • 按照此步骤
  • 我下载了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
  • 遏制宝石
  • 我将.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一起使用

I do not know what to do. How to successfully install libcurl on Windows for use with Rails

推荐答案

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

Answer that worked for me (W10/Ruby2.6.0) was:

  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目录中
  1. Download cURL from the following URL: https://curl.haxx.se/windows/ (I chose 64bit because that's the system I'm using)
  2. Go into the archive and browse to /bin
  3. Locate libcurl_x64.dll (it may be just libcurl.dll)
  4. Extract to your local drive
  5. Rename it to libcurl.dll if it has the _x64 suffix
  6. Cut + paste the file into the /bin directory of your Ruby installation

这篇关于如何解决Windows上Rails找不到的'libcurl'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆