I have a Gem which has the following structure:
gem
|
|- lib/
|
|- gem.rb
|- gem/
|
|- router.rb
Inside gem.rb, there’s the following code:
module Gem
VERSION = '0.1.8.beta'
end
require 'gem/router'
However, despite using hundreds of functions and methods of my knowledge, router.rb cannot be required!
Any tips? Thanks.
One of two things could be happening. If you are on 1.8.7 and friends, Ruby is probably seeing some standard library folder called
gem(don’t name things after standard libraries). If you are using Ruby 1.9.*, you must use a method calledrequire_relativethat only searches relative to the current working directory.