0

我用

$ gem build <gemspec>

它构建成功,我成功安装了它。

但是当我执行以下操作时:

$ irb -rubygems
irb(main):003:0 require 'xxxx'

我收到以下错误:

LoadError: no such file to load -- xxxx
 from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in 'gem_original_require'
 from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in 'require'

我究竟做错了什么?

4

1 回答 1

0

你也可以发布你的.gemspec文件吗?

您很可能没有将文件包含在.files数组中。例如,

Gem::Specification.new do |s|
  # Other specifications
  s.files       = ["bin/google", "lib/google.rb", "lib/google/utils.rb"]
  s.files      += ["LICENSE.md", "README.md", "google.gemspec"]
end
于 2012-05-25T18:21:19.083 回答