1

I tried to install the puma because when I tried bundle, it said I need to install the puma, but when I tried to install it, I got this error

gem install puma -v '3.12.6' --source 'https://rubygems.org/' Temporarily enhancing PATH to include DevKit... Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing puma: ERROR: Failed to build gem native extension.

    current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-3.12.6/ext/puma_http11
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210202-20756-30084d.rb extconf.rb
checking for BIO_read() in -lcrypto... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME)
        --with-puma_http11-dir
        --without-puma_http11-dir
        --with-puma_http11-include
        --without-puma_http11-include=${puma_http11-dir}/include
        --with-puma_http11-lib
        --without-puma_http11-lib=${puma_http11-dir}/lib
        --with-openssl-dir
        --without-openssl-dir
        --with-openssl-include
        --without-openssl-include=${openssl-dir}/include
        --with-openssl-lib
        --without-openssl-lib=${openssl-dir}/lib
        --with-cryptolib
        --without-cryptolib
C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:552:in `try_link0'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:782:in `try_func'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1016:in `block in have_library'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1011:in `have_library'
        from extconf.rb:8:in `block in <main>'
        from extconf.rb:8:in `each'
        from extconf.rb:8:in `find'
        from extconf.rb:8:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/puma-3.12.6/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-3.12.6 for inspection.
Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/puma-3.12.6/gem_make.out

This is the mkmg.log file. I thought it is because I didn't' download the devkit so I downloaded the dev kit and I did ruby dk.rb init, dk.rb install --force but it doesn't work.

   "x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby26-x64/include/ruby-2.6.0/x64-mingw32 -IC:/Ruby26-x64/include/ruby-2.6.0/ruby/backward -IC:/Ruby26-x64/include/ruby-2.6.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math conftest.c  -L. -LC:/Ruby26-x64/lib -L. -pipe -s     -lx64-msvcrt-ruby260  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

My gem env outputs are

    RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.7
  - RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [x64-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby26-x64/lib/ruby/gems/2.6.0   
  - USER INSTALLATION DIRECTORY: C:/Users/Kim/.gem/ruby/2.6.0 
  - RUBY EXECUTABLE: C:/Ruby26-x64/bin/ruby.exe
  - GIT EXECUTABLE: C:\Program Files\Git\cmd/git.EXE
  - EXECUTABLE DIRECTORY: C:/Ruby26-x64/bin
  - SPEC CACHE DIRECTORY: C:/Users/Kim/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
     - ruby
     - x64-mingw32
  - GEM PATHS:
     - C:/Ruby26-x64/lib/ruby/gems/2.6.0
     - C:/Users/Kim/.gem/ruby/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - c:\program files\graphicsmagick-1.3.35-q16
     - C:\Program Files\Microsoft MPI\Bin\
     - C:\Program Files (x86)\Common Files\Oracle\Java\javapath
     - C:\Windows\system32
     - C:\Windows
     - C:\Windows\System32\Wbem
     - C:\Windows\System32\WindowsPowerShell\v1.0\
     - C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
     - C:\Program Files\Intel\WiFi\bin\
     - C:\Program Files\Common Files\Intel\WirelessCommon\
     - C:\WINDOWS\system32
     - C:\WINDOWS
     - C:\WINDOWS\System32\Wbem
     - C:\WINDOWS\System32\WindowsPowerShell\v1.0\
     - C:\WINDOWS\System32\OpenSSH\
     - C:\Program Files\Java\jdk-10.0.2\bin
     - C:\Users\Kim\Desktop\mysql-8.0.16-winx64\mysql-8.0.16-winx64\bin
     - C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
     - C:\WINDOWS\system32
     - C:\WINDOWS
     - C:\WINDOWS\System32\Wbem
     - C:\WINDOWS\System32\WindowsPowerShell\v1.0\
     - C:\WINDOWS\System32\OpenSSH\
     - C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
     - C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\
     - C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
     - C:\Program Files\Microsoft SQL Server\150\DTS\Binn\
     - C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
     - C:\Program Files (x86)\Brackets\command
     - C:\Program Files\dotnet\
     - C:\Program Files\Git\cmd
     - C:\Program Files (x86)\dotnet\
     - C:\Program Files\CMake\bin
     - C:\Program Files\PostgreSQL\13\lib
     - C:\Program Files\PostgreSQL\13\bin
     - C:\Program Files\GraphicsMagick-1.3.35-Q16
     - C:\MinGW\bin
     - C:\Ruby26-x64\devkit\bin
     - C:\msys64\mingw64\bin
     - C:\msys64\mingw64\lib
     - C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
     - C:\Ruby26-x64\devkit\mingw\bin
     - C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0
     - C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\tr1
     - C:\Ruby26-x64\bin
     - C:\Users\Kim\AppData\Local\Programs\Microsoft VS Code\bin
     - C:\Users\Kim\AppData\Local\Microsoft\WindowsApps
     - C:\Users\\.dotnet\tools
     - C:\Users\Kim\AppData\Local\GitHubDesktop\bin
     - C:\Program Files (x86)\GitHub CLI\
kim
  • 11
  • 2
  • Hi! Have you run `gem install rails`? The rails server comes with the installation of rails so I find this very puzzling. – GLaDOS Feb 03 '21 at 00:56
  • Also you might want to check out this thread: https://stackoverflow.com/questions/164896/limitations-in-running-ruby-rails-on-windows – GLaDOS Feb 03 '21 at 00:57
  • You'd be a lot happier not trying to do Rails on Windows, or for that matter anything that requires a real `*nix` type environment. I tried for a week to use [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) but the hair pulling left me bald. You're better off using Virtual Box and run a linux system inside of it IMHO. However I tried that too and latest Windows doesn't support it! So go with [VMWare Player](https://www.vmware.com/products/workstation-player.html) instead. – lacostenycoder Feb 03 '21 at 01:02
  • I could successfully run the rails server before, however after my coworker updated some gems, it didn't work. I got errors on bcrypt, JSON, and puma. – kim Feb 03 '21 at 02:11
  • what is output of `gem env` ? – lacostenycoder Feb 03 '21 at 02:21
  • I added the output on the post – kim Feb 03 '21 at 16:16

0 Answers0