dependency cannot load gems whose library file is different from the gem directory name
Reported by David Lee | June 14th, 2008 @ 02:38 PM | in 1.0 Final
You can't require libraries that are within directories using dependency.
example: gem install google4r-maps
dependency 'google4r/maps' # error
require 'google4r/maps' # this works
Comments and changes to this ticket
-

David Lee June 15th, 2008 @ 10:00 AM
- → Title changed from dependency cannot load libraries from within directories to dependency cannot load gems whose library file is different from the gem directory name
Dependency does not load from gems whose gem name (directory name) is different from the actual .rb file name.
For example:
GeoRuby-1.3.3/lib/geo_ruby.rb
(GeoRuby != geo_ruby)
google4r-maps-0.1.0/lib/google4r/maps.rb
(google4r-maps != google4r/maps)
RubyInline-3.7.0/lib/inline.rb
(RubyInLine != inline.rb)
-

David Lee June 15th, 2008 @ 10:45 AM
In fact, you can't even load RedCloth as the config/init.rb example says because RedCloth is the gem (and directory) name, but redcloth.rb is the filename.
Maybe this is a rubygems problem. I'm currently using the latest rubygems (version 1.1.1).
-
Michael Klishin (antares) June 28th, 2008 @ 01:42 PM
- → Tag cleared.
- → Milestone changed from to 0.9.4
- → State changed from new to open
dependencies will be gone before 1.0, just use require.
-
Michael Klishin (antares) August 2nd, 2008 @ 06:40 PM
- → Milestone changed from 0.9.4 to 0.9.6
-
Michael Klishin (antares) September 4th, 2008 @ 11:53 AM
- → Milestone changed from 0.9.6 to 0.9.7
-
Michael Klishin (antares) September 14th, 2008 @ 02:00 AM
- → Milestone changed from 0.9.7 to 0.9.9
-
Yehuda Katz (wycats) September 19th, 2008 @ 11:44 AM
- → Assigned user changed from to Yehuda Katz (wycats)
@antares we're not getting rid of require, and dependency should be improved to support these cases.
-
Michael Klishin (antares) October 7th, 2008 @ 12:02 PM
- → Milestone changed from 0.9.9 to 1.0 Final
-
Michael Jones October 20th, 2008 @ 12:44 PM
- → State cleared.
Are you sure this is a bug? Cant you just do something like...
dependency "rest-client" do require 'rest_client' end
-
Rob Kaufman October 20th, 2008 @ 08:01 PM
I added a wiki page at http://wiki.merbivore.com/howto/... to describe this technique. Seems like it should also be in the rdoc for dependency. With Githubs popularity being so high a lot of people are asking this question.
-
Yehuda Katz (wycats) November 7th, 2008 @ 04:46 AM
- → State changed from to resolved
The new solution is to use :require_as, which is described at http://wiki.merbivore.com/howto/.... This is the final 1.0 API.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
