我正在尝试使用savon Gem,以便与web服务交互。所以我安装了它,看起来安装还可以:
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
有人遇到同样的问题吗(我运行回溯5上次发布)
谢谢
看起来有两个rubie,系统一个(1.9.2dev)和jruby。当您运行ruby
或gem
时,它会获取系统ruby,而jruby -S buby
命令会获取jruby。
如果运行:
jruby -rubygems -e 'require "savon"'
这很可能会失败。
要在jruby实例上安装savon,请运行:
jruby -S gem install savon
这应该可以解决问题。