gem packetfu LoadError

时间:2012-08-16 03:07:31

标签: ruby gem

我正在尝试使用packetfu gem。我是铁轨上的红宝石,所以请耐心等待。我正在使用rvm和ruby-1.9.3-head [x86_64]。我也有Mac OSX 10.7.4我在尝试运行sudo ruby​​ app / models / simpleSniff.rb时收到此错误

/Users/aragorn/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- packetfu (LoadError)
from /Users/aragorn/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from app/simpleSniff.rb:2:in `<main>'

simpleSniff.rb中包含的代码是

#!/usr/bin/env ruby
require 'packetfu'

include PacketFu
iface = "eth1"

cap = Capture.new(:iface => iface, :start => true)
cap.stream.each do |p|
 put p
end

$ gem list *本地宝石*

actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
arel (3.0.2)
builder (3.0.0)
bundler (1.1.5)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.4)
jquery-rails (2.0.2)
json (1.7.4)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
packetfu (1.1.5)
pcaprub (0.11.2)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
rspec (2.11.0, 0.9.4)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
rspec-mocks (2.11.2)
rubygems-bundler (1.0.6)
rvm (1.11.3.5)
sass (3.2.1)
sass-rails (3.2.5)
sdoc (0.3.16)
sprockets (2.1.3)
sqlite3 (1.3.6)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
uglifier (1.2.7)

然后我的Gemfile终于

source 'http://rubygems.org'
gem "rails", "3.2.8"
gem "rspec", "~> 0.9.2"
gem "sdoc", "~> 0.3.16"
gem "pcaprub", "~> 0.11.2"
gem "packetfu", "~>1.1.5"
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'

1 个答案:

答案 0 :(得分:0)

A)特别要求问题是因为你是sudo'ing而不是rvmsudo'ing(这将保持你的红宝石环境的机智)

B)如果PacketFu和Pcaprub以及注射和捕获都在您的OS X机器上运行,请告诉我!我会感到震惊和敬畏。对于某些人,我听说它有效。不过,我从来没有真正用自己的眼球看过它。