| Message: 64294 |
 |
BY: Glenn West (glennswest) DATE: 2009-01-30 04:01 SUBJECT: RE: Issues after gem install I had a similar problem on a mac clean install. (And a new model mac).
Only dbi-0.4.2 was ever installed as far as I know.
I even erased all gems, and did a fresh install.
Still nothing.
I copied the dbd into the local dir, and it worked. (It was not searching the gems).
I tracked the problem to a FIXME in collect gems.
I patched it today.
In my case I was just doing dbi and sqlite3.
#
# Return a list (of String) of the available drivers.
#
# NOTE:: This is non-functional for gem installations, due to the
# nature of how it currently works. A better solution for
# this will be provided in DBI 0.6.0.
def collect_drivers
drivers = { }
# FIXME rewrite this to leverage require and be more intelligent
path = File.join(File.dirname(__FILE__), "dbd", "*.rb")
Dir[path].each do |f|
if File.file?(f)
driver = File.basename(f, ".rb")
drivers[driver] = f
end
end
Gem::SourceIndex.from_installed_gems.each do |gem_name, gem_spec|
if gem_name[0,3] == 'dbd'
gem_directory = File.join(Gem.dir, "gems", gem_spec.full_name, "lib", "dbd", "*.rb")
Dir[gem_directory].each do |f|
if File.file?(f)
driver = File.basename(f,".rb")
drivers[driver] = f
end
end
end
end
return drivers
end
| |