RubyGems 包含在 jRuby 1.7.4 ( jruby.org ) 的(一部分)中,archive-tar-minitar 是“in”RubyGems。不是吗?? http://rubygems.org/gems/archive-tar-minitar
那么为什么我不能运行这个例子:http ://rubydoc.info/gems/archive-tar-minitar/0.5.2/frames
require 'zlib'
require 'archive/tar/minitar'
include Archive::Tar
# Packs everything that matches Find.find('tests')
File.open('test.tar', 'wb') { |tar| Minitar.pack('tests', tar) }
# Unpacks 'test.tar' to 'x', creating 'x' if necessary.
Minitar.unpack('test.tar', 'x')
我得到了错误:
LoadError: no such file to load -- archive/tar/minitar
require at org/jruby/RubyKernel.java:1054
require at C:/jruby-1.7.4/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:51
(root) at EssRB.rb:23
我想我必须先安装 archive-tar-minitar 谢谢和问候。