From: Jon Forums Date: 2012-01-21T04:28:08+09:00 Subject: Re: Installing PCAP > That said, I've just downloaded the WinPcap dev pack from > http://www.winpcap.org/devel.htm and will hopefully find time this > weekend to get the `pcap` and `packetfu` gems to work on my Win7 32bit > w/1.9.3 system. See if this quick hack will get you up and running. The real solution would be to update the project to use https://github.com/luislavena/rake-compiler and a few other tweaks. I'd love to hear if it really works beyond the simple IRB tests I did. 1) extract `WpdPack_4_1_2.zip` WpdPack directory to `c:\devlibs\winpcap` 2) unpack the current gem C:\Users\Jon\Downloads\temp>gem unpack pcaprub-0.11.2.gem Unpacked gem: 'C:/Users/Jon/Downloads/temp/pcaprub-0.11.2' 3) edit pcaprub.gemspec, lib\pcaprub\version.rb, and ext\pcaprub\extconf.rb with the following mods. https://github.com/shadowbq/pcaprub/blob/master/pcaprub.gemspec#L8 change to "0.11.3.a1" https://github.com/shadowbq/pcaprub/blob/master/lib/pcaprub/version.rb#L7-9 change to... TINY = 3 PATCH = 'a1' STRING = [MAJOR, MINOR, TINY, PATCH].join('.') https://github.com/shadowbq/pcaprub/blob/master/ext/pcaprub/extconf.rb#L18-20 add these two lines after those (note space after opening quote)... $CFLAGS << " -DWIN32 -I#{pcap_includedir}" $LDFLAGS << " -L#{pcap_libdir}" 4) build an updated gem, install it, and install `packetfu` C:\Users\Jon\Downloads\temp\pcaprub-0.11.2>gem build pcaprub.gemspec Successfully built RubyGem Name: pcaprub Version: 0.11.3.a1 File: pcaprub-0.11.3.a1.gem C:\Users\Jon\Downloads\temp\pcaprub-0.11.2>gem install pcaprub0.11.3.a1.gem -- --with-pcap-dir=c:/devlibs/winpcap Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... Successfully installed pcaprub-0.11.3.a1 1 gem installed C:\Users\Jon\Downloads\temp>gem install packetfu-1.1.5.gem Successfully installed packetfu-1.1.5 1 gem installed 5) simple tests irb(main):001:0> RUBY_DESCRIPTION => "tcs-ruby 1.9.3p6 (2011-12-20, TCS patched 2011-12-23) [i386-mingw32]" irb(main):002:0> require 'pcaprub' => true irb(main):003:0> PCAPRUB::VERSION::STRING => "0.11.3.a1" irb(main):004:0> Pcap.singleton_methods.sort => [:lookupdev, :lookupnet, :new, :open_dead, :open_live, :open_offline, :version] irb(main):005:0> require 'packetfu' => true irb(main):006:0> PacketFu::VERSION => "1.1.5" irb(main):007:0> PacketFu.pcaprub_loaded? => true Jon --- Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat. http://thecodeshop.github.com | http://jonforums.github.com/ twitter: @jonforums -- Posted via http://www.ruby-forum.com/.