我正在尝试通过 activemdb gem 访问 Rails 中的 mdb 文件。我遇到的问题是,当我尝试访问或使用此 gem 时,它会出现以下错误
NameError: uninitialized constant ActiveMDB
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:469:in `load_missing_constant'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'
from /home/confiz/Project/redmine/LMS/redmine-1.4/app/models/beacon.rb:2
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:406:in `load_file'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:405:in `load_file'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:285:in `require_or_load_without_engine_additions'
from /home/confiz/Project/redmine/LMS/redmine-1.4/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:132:in `require_or_load'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:451:in `load_missing_constant'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing'
from /home/confiz/.rvm/gems/ruby-1.8.7-p358@lms/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'
from (irb):1
这是我的宝石清单
*** LOCAL GEMS ***
actionmailer (2.3.14)
actionpack (2.3.14)
activemdb (0.2.2)
activerecord (2.3.14)
activeresource (2.3.14)
activesupport (2.3.14)
bundler (1.1.3)
coderay (1.0.7)
edavis10-object_daddy (0.4.3)
fastercsv (1.5.5)
hoe (3.0.8)
i18n (0.4.2)
json (1.7.5)
metaclass (0.0.1)
mocha (0.12.3)
mysql (2.8.1)
net-ldap (0.3.1)
rack (1.1.3)
rails (2.3.14)
rake (0.9.2.2)
rdoc (3.12)
rmagick (2.13.1)
ruby-openid (2.1.8)
rubygems-bundler (0.2.8)
rvm (1.11.3.3)
shoulda (2.10.3)
sqlite3 (1.3.6)
tzinfo (0.3.33)
在这里我访问activemdb的代码
class Beacon < ActiveMDB::Base
set_mdb_file 'att2000.mdb'
end