Centos 7 gem install -v=0.12.0 pcaprub 出错解决办法

Metasploit此乃渗透工程师必备神器,在Centos 7下安装Metaspoit软件,需要安装很多Ruby的Bundle,其中一个就是Pcaprub,在运行安装命令:gem install -v=0.12.0 pcaprub,出现以下错误提示:ERROR:  Error installing pcaprub:
ERROR: Failed to build gem native extension.


解决办法如下:

1. 使用yum安装libpcap

[ocean@localhost include]$ yum list libcap
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
  * base: mirror.netaddicted.ca
  * elrepo: reflector.westga.edu
  * epel: mirror.steadfast.net
  * extras: mirror.netaddicted.ca
  * linuxtech-release: pkgrepo.linuxtech.net
  * nux-dextop: mirror.li.nux.ro
  * updates: mirror.netaddicted.ca
已安装的软件包
libcap.x86_64                     2.22-8.el7                      @anaconda     
可安装的软件包
libcap.i686                       2.22-8.el7                      C7.0.1406-base


2. 安装nmap工具

cd /usr/src

svn co https://svn.nmap.org/nmap

cd nmap

./configure

make

make install

make clean


3. 拷贝pcap目录和pcap.h到/usr/local/include目录

cp /usr/src/nmap/libpcap/pcap.h /usr/local/include

cp -r /usr/src/nmap/libpcap/pcap /usr/local/include


4. 重新运行安装命令:gem install -v=0.12.0 pcaprub

问题解决。

[ocean@localhost config]$ gem install -v=0.12.0 pcaprub
Building native extensions.  This could take a while...
Successfully installed pcaprub-0.12.0
Parsing documentation for pcaprub-0.12.0
Done installing documentation for pcaprub after 0 seconds
1 gem installed


你可能感兴趣的:(centos,Install,Ruby,gem,pcaprub)