我正在开发一个简单的 ruby gem,其中我需要额外的类。以下是我的 gemname/lib 目录的文件:
lib/
gemname/
base.rb
version.rb
gemname.rb
我已将声明包含require "gemname/base"
在我的 gemname.rb 中。
在本地构建和安装 gem 并转到irb
andrequire gemname
后,我收到以下错误:
LoadError: cannot load such file -- ./gemname/base
from /home/swaroop/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
from /home/swaroop/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
from /home/swaroop/.rvm/gems/ruby-2.0.0-p0/gems/gemname-0.0.6/lib/gemname.rb:2:in `<top (required)>'
from /home/swaroop/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `require'
from /home/swaroop/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `rescue in require'
from /home/swaroop/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:122:in `require'
from (irb):1
from /home/swaroop/.rvm/rubies/ruby-2.0.0-p0/bin/irb:13:in `<main>'
我哪里错了?