rubyrubygemsundefined-reference

Could not find packetfu-2.0.0, pcaprub-0.13.3 in cached gems or installed locally


hello everyone i'm new in ruby , i am using rubyMine 2024.2.3 , with rubyinstaller-devkit-3.2.5-1-x64_2

i've been tryin to run a command using terminal , and this the error message that's shown

Could not find packetfu-2.0.0, pcaprub-0.13.3 in cached gems or installed locally

i searched about the problem in a lot of websites and I found some answers but none of them worked with me

first solution is runing those cammands in the terminal :

gem install pcaprub -v 0.13.3

and also this command

gem install packetfu -v 2.0.0

and when i try to run them a lot of errors shown in the console of terminal

also i try with this solution also :

i dawnloaded npcap from here https://sourceforge.net/projects/rubypcap/

than i added a new variables in the environement variables using those commands

setx PCAP_DIR "C:\Program Files\Npcap"
setx PATH "%PATH%;C:\Program Files\Npcap\include;C:\Program Files\Npcap\lib"

and tryed again with

gem install pcaprub -v 0.13.3
gem install packetfu -v 2.0.0

and this is the error list shown

Using rubygems directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0                            
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing pcaprub:
        ERROR: Failed to build gem native extension.

    current directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3/ext/pcaprub_c
H:/ruby/installation/Ruby32-x64/bin/ruby.exe extconf.rb

[*] Running checks for pcaprub_c code...
platform is x64-mingw-ucrt
checking for -lws2_32... yes
checking for -liphlpapi... yes
checking for windows.h... yes
checking for winsock2.h... yes
checking for iphlpapi.h... yes
checking for ruby/thread.h... yes
checking for C:/WpdPack/include/Win32-Extensions.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl()... yes
checking for pcap_open_live() in -lwpcap... no
checking for pcap_setnonblock() in -lwpcap... no
creating Makefile

current directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3/ext/pcaprub_c
make DESTDIR\= sitearchdir\=./.gem.20241011-12776-e0ln1y sitelibdir\=./.gem.20241011-12776-e0ln1y clean

current directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3/ext/pcaprub_c
make DESTDIR\= sitearchdir\=./.gem.20241011-12776-e0ln1y sitelibdir\=./.gem.20241011-12776-e0ln1y
generating pcaprub_c-x64-mingw-ucrt.def
compiling pcaprub.c
linking shared-object pcaprub_c.so
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x6b5): undefined reference to `pcap_lib_version'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x6f5): undefined reference to `pcap_findalldevs'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x7cd): undefined reference to `pcap_freealldevs'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x841): undefined reference to `pcap_lookupnet'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x94f): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x96c): undefined reference to `pcap_dump_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xba0): undefined reference to `pcap_set_timeout'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xbf5): undefined reference to `pcap_list_datalinks'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xc2e): undefined reference to `pcap_datalink_val_to_name'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xc91): undefined reference to `pcap_free_datalinks'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xca6): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xd35): undefined reference to `pcap_datalink_name_to_val'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xd91): undefined reference to `pcap_set_datalink'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xdaf): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xe3e): undefined reference to `pcap_set_snaplen'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xed6): undefined reference to `pcap_set_promisc'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xfe7): undefined reference to `pcap_lookupnet'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1047): undefined reference to `pcap_compile'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x105d): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x108f): undefined reference to `pcap_setfilter'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x109f): undefined reference to `pcap_freecode'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x10b1): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x10d9): undefined reference to `pcap_freecode'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1140): undefined reference to `pcap_compile'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1153): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x117b): undefined reference to `pcap_freecode'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x11b0): undefined reference to `pcap_activate'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1217): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x12d8): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x12f6): undefined reference to `pcap_create'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1529): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1579): undefined reference to `pcap_open_live'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x16e3): undefined reference to `pcap_open_offline'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x184b): undefined reference to `pcap_open_dead'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1941): undefined reference to `pcap_dump_open'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x19e8): undefined reference to `pcap_dump_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1bbb): undefined reference to `pcap_sendpacket'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1bce): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1ca6): undefined reference to `pcap_setnonblock'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1cce): undefined reference to `pcap_dispatch'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1dbc): undefined reference to `pcap_setnonblock'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1de4): undefined reference to `pcap_dispatch'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1ef7): undefined reference to `pcap_getevent'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1fa9): undefined reference to `pcap_getevent'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x205b): undefined reference to `pcap_datalink'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x20a9): undefined reference to `pcap_major_version'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x20f7): undefined reference to `pcap_minor_version'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x2145): undefined reference to `pcap_snapshot'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x219d): undefined reference to `pcap_stats'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:265: pcaprub_c.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3 for inspection.
Results logged to C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/extensions/x64-mingw-ucrt/3.2.0/pcaprub-0.13.3/gem_make.out
PS C:\Users\nacereddine\RubymineProjects\checkwallets\metasploit-framework-master> gem install pcaprub -v 0.13.3
Using rubygems directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing pcaprub:
        ERROR: Failed to build gem native extension.

    current directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3/ext/pcaprub_c
H:/ruby/installation/Ruby32-x64/bin/ruby.exe extconf.rb

[*] Running checks for pcaprub_c code...
platform is x64-mingw-ucrt
checking for -lws2_32... yes
checking for -liphlpapi... yes
checking for windows.h... yes
checking for winsock2.h... yes
checking for iphlpapi.h... yes
checking for ruby/thread.h... yes
checking for C:/WpdPack/include/Win32-Extensions.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl()... yes
checking for pcap_open_live() in -lwpcap... no
checking for pcap_setnonblock() in -lwpcap... no
creating Makefile

current directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3/ext/pcaprub_c
make DESTDIR\= sitearchdir\=./.gem.20241011-12232-7ujtez sitelibdir\=./.gem.20241011-12232-7ujtez clean

current directory: C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3/ext/pcaprub_c
make DESTDIR\= sitearchdir\=./.gem.20241011-12232-7ujtez sitelibdir\=./.gem.20241011-12232-7ujtez
generating pcaprub_c-x64-mingw-ucrt.def
compiling pcaprub.c
linking shared-object pcaprub_c.so
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x6b5): undefined reference to `pcap_lib_version'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x6f5): undefined reference to `pcap_findalldevs'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x7cd): undefined reference to `pcap_freealldevs'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x841): undefined reference to `pcap_lookupnet'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x94f): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x96c): undefined reference to `pcap_dump_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xba0): undefined reference to `pcap_set_timeout'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xbf5): undefined reference to `pcap_list_datalinks'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xc2e): undefined reference to `pcap_datalink_val_to_name'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xc91): undefined reference to `pcap_free_datalinks'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xca6): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xd35): undefined reference to `pcap_datalink_name_to_val'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xd91): undefined reference to `pcap_set_datalink'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xdaf): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xe3e): undefined reference to `pcap_set_snaplen'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xed6): undefined reference to `pcap_set_promisc'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0xfe7): undefined reference to `pcap_lookupnet'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1047): undefined reference to `pcap_compile'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x105d): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x108f): undefined reference to `pcap_setfilter'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x109f): undefined reference to `pcap_freecode'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x10b1): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x10d9): undefined reference to `pcap_freecode'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1140): undefined reference to `pcap_compile'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1153): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x117b): undefined reference to `pcap_freecode'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x11b0): undefined reference to `pcap_activate'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1217): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x12d8): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x12f6): undefined reference to `pcap_create'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1529): undefined reference to `pcap_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1579): undefined reference to `pcap_open_live'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x16e3): undefined reference to `pcap_open_offline'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x184b): undefined reference to `pcap_open_dead'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1941): undefined reference to `pcap_dump_open'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x19e8): undefined reference to `pcap_dump_close'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1b1f): undefined reference to `pcap_dump'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1bce): undefined reference to `pcap_geterr'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1ca6): undefined reference to `pcap_setnonblock'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1cce): undefined reference to `pcap_dispatch'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1dbc): undefined reference to `pcap_setnonblock'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1de4): undefined reference to `pcap_dispatch'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1ef7): undefined reference to `pcap_getevent'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x1fa9): undefined reference to `pcap_getevent'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x205b): undefined reference to `pcap_datalink'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x20a9): undefined reference to `pcap_major_version'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x20f7): undefined reference to `pcap_minor_version'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x2145): undefined reference to `pcap_snapshot'
H:/ruby/installation/Ruby32-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o:pcaprub.c:(.text+0x219d): undefined reference to `pcap_stats'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:265: pcaprub_c.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/gems/pcaprub-0.13.3 for inspection.
Results logged to C:/Users/nacereddine/.local/share/gem/ruby/3.2.0/extensions/x64-mingw-ucrt/3.2.0/pcaprub-0.13.3/gem_make.out

Solution

  • i found the solution

    first step : dawnload Npcap SDK 1.13 (ZIP). from https://npcap.com/#download

    second step : unzip the Npcap SDK 1.13into folder which called WpdPack like this C:\WpdPack

    step three :

    run the commands of installing normally

    gem install packetfu -v 2.0.0
    gem install pcaprub -v 0.13.3