在缓存的gems中或本地安装时找不到packetfu-2.0.0、pcaprub-0.13.3

问题描述 投票:0回答:1

大家好,我是 ruby 新手,我正在使用 rubyMine 2024.2.3 ,以及 rubyinstaller-devkit-3.2.5-1-x64_2

我一直在尝试使用终端运行命令,这是显示的错误消息

在缓存的gems中或本地安装时找不到packetfu-2.0.0、pcaprub-0.13.3

我在很多网站上搜索了这个问题,找到了一些答案,但没有一个对我有用

第一个解决方案是在终端中运行这些命令:

gem install pcaprub -v 0.13.3

还有这个命令

gem install packetfu -v 2.0.0

当我尝试运行它们时,终端控制台中显示了很多错误

我也尝试使用这个解决方案:

我从这里加载了npcaphttps://sourceforge.net/projects/rubypcap/

我使用这些命令在环境变量中添加了一个新变量

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

并再次尝试

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

这是显示的错误列表

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
ruby rubygems undefined-reference
1个回答
0
投票

我找到了解决方案

第一步: 黎明负载Npcap SDK 1.13(ZIP)。 来自 https://npcap.com/#download

第二步:Npcap SDK 1.13解压到名为WpdPack的文件夹中,如下所示 C:\WpdPack

第三步:

运行正常安装的命令

gem install packetfu -v 2.0.0
gem install pcaprub -v 0.13.3
© www.soinside.com 2019 - 2024. All rights reserved.