How to solve 'libcurl' not found with Rails on Windows

前端 未结 9 1088
旧巷少年郎
旧巷少年郎 2020-12-05 17:48

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         


        
相关标签:
9条回答
  • 2020-12-05 18:09

    Well, the issue is caused by a missing lib as said in the error, So the solution is to download the lib here: http://www.dlldownloader.com/libcurl-dll/ and navigate to the ruby folder under bin and drop it there make sure to rename the downloaded .dll file to this exact one: libcurl.dll else won't work even after.

    0 讨论(0)
  • 2020-12-05 18:13

    None of the solutions worked for me - no matter what I tried, libcurl failed to load.

    I then did the following:

    1. Created a mini Ruby program that just tried loading the dll:
    require 'ffi'
    
    FFI::DynamicLibrary.open("libcurl", FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_LOCAL)
    
    1. Ran procmon and filtered by ruby.exe process and any path containing "dll"

    As a result, I saw the following:

    C:\Ruby27-x64\bin\libzstd.dll - NAME NOT FOUND

    That gave me an idea that I was missing a dependency. The libzstd.dll file is part of the mingw-w64-x86_64-zstd package but luckily I just had it sitting on my drive elsewhere (as part of the GIMP installation).

    I copied libzstd.dll to C:\Ruby27-x64\bin and the problem was solved. Of course, I had libcurl.dll in my path already (got it from https://curl.haxx.se/windows)

    0 讨论(0)
  • 2020-12-05 18:15

    If you're using WSL on Windows 10 (Make sure to update to Ubuntu 16.04) the following instructions worked perfectly for me. You might need to completely wipe what you have installed however. Within bash:

    sudo apt-get update
    sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev postgresql-client-common postgresql-client libpq-dev
    

    And then to build our path and plugin directory for rbenv:

    cd
    git clone https://github.com/rbenv/rbenv.git ~/.rbenv
    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
    echo 'eval "$(rbenv init -)"' >> ~/.bashrc
    exec $SHELL
    git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
    echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
    exec $SHELL
    

    Finally we come to ruby:

    rbenv install 2.4.1
    rbenv global 2.4.1
    

    Then bundler:

    gem install bundler
    rbenv rehash
    

    Now our prerequisites:

    curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    And then finally Rails:

    gem install rails
    rbenv rehash
    
    0 讨论(0)
  • 2020-12-05 18:17

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

    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
    0 讨论(0)
  • 2020-12-05 18:21

    I want to use wpscan, but i get libcurl error OK, if you also get the same error, then in a very easy way I will try to give the solution.

    Just copy the libcurl.dll file to system32 if your windows is 32 bit,

    If your windows 64 bit copied to syswo64.

    Good luck.

    0 讨论(0)
  • 2020-12-05 18:25

    For anyone running Ruby 2.5 on Windows, my solution was similar to the top solutions however I had to move it to place the file in both the \bin folder and \bin\ruby_builtin_dlls folder to work.

    Some other things is that I downloaded the 64bit version and changed its name to libcurl.dll. Also make sure to restart your IDE/terminal and then try to start the server again.

    0 讨论(0)
提交回复
热议问题