我正在尝试使用savon Gem,以便与webServices交互。 所以我安装了它,似乎安装还可以:
gem list savon
*** LOCAL GEMS ***
savon (1.2.0)
我可以使用简单的命令测试它:
ruby -rubygems -e 'require "savon"'
(感谢此提示我没有更多错误http://wiki.mccune.org.uk/index.php/Backtrack)
当我想使用需要savon的.rb脚本时会出现问题:
jruby -S buby -i -B /pentest/web/burpsuite/burpsuite_v1.4.01.jar -r /home/fred/soapAtk2.rb
/usr/lib/jruby//lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:75 warning: already initialized constant StartBurp
Your JRE appears to be OpenJDK.
Burp has not been fully tested on this platform and you may experience problems.
Loading: "/home/fred/soapAtk2.rb"
/usr/lib/jruby//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in **`require': no such file to load -- savon** (LoadError)
from /usr/lib/jruby//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /home/fred/soapAtk2.rb:3
from /home/fred/soapAtk2.rb:31:in `require'
from /usr/lib/jruby//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/jruby/lib/ruby/gems/1.8/gems/buby-1.3.1-java/bin/buby:63
from /usr/lib/jruby/lib/ruby/gems/1.8/gems/buby-1.3.1-java/bin/buby:63:in `each'
from /usr/lib/jruby/lib/ruby/gems/1.8/gems/buby-1.3.1-java/bin/buby:63
from /usr/lib/jruby/lib/ruby/gems/1.8/gems/buby-1.3.1-java/bin/buby:19:in `load'
from /usr/lib/jruby/bin/buby:19
似乎存在环境问题,但我无法弄清楚如何解决它: - /
ruby -r rubygems -e "p Gem.path"
["/root/.gem/ruby/1.9.2", "/usr/lib/ruby/gems/1.9.2"]
# gem content savon
/var/lib/gems/1.9.2/gems/savon-1.2.0/.gitignore
/var/lib/gems/1.9.2/gems/savon-1.2.0/.rspe
...
...
其他信息
# ruby -v
ruby 1.9.2dev (2010-07-02) [x86_64-linux]
# gem -v
1.3.7
有没有人遇到同样的问题(我在上次发布时运行backtrack5)
感谢
答案 0 :(得分:0)
看起来你有两颗红宝石,系统一(1.9.2dev)和jruby。当您运行ruby
或gem
时,它会选择系统ruby,而jruby -S buby
命令会选择jruby。
如果你跑:
jruby -rubygems -e 'require "savon"'
这很可能会失败。
要在jruby实例上安装savon,请运行:
jruby -S gem install savon
这应解决问题。