0

你能帮我解决这个问题吗?

gem list显示dm-mysql-adapter已经安装,但是merb无法加载。我只想启动一个由merb-gen生成的简单merb应用程序。

Loading init file from ./config/init.rb
Loading ./config/environments/development.rb
/usr/lib/ruby/gems/1.8/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:163:in `require': no such file to load -- dm-mysql-adapter (LoadError)
    from /usr/lib/ruby/gems/1.8/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:163:in `load_adapter'
    from /usr/lib/ruby/gems/1.8/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:133:in `adapter_class'
    from /usr/lib/ruby/gems/1.8/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:13:in `new'
    from /usr/lib/ruby/gems/1.8/gems/dm-core-1.2.0/lib/dm-core.rb:230:in `setup'
    from /home/pl/merb/merb-f/config/environments/development.rb:18
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:498:in `load'
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:498:in `load_env_config'
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:378:in `run'
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:97:in `run'
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/server.rb:172:in `bootup'
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/server.rb:42:in `start'
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core.rb:165:in `start'
    from /usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/bin/merb:20
    from /usr/local/bin/merb:19:in `load'
    from /usr/local/bin/merb:19
me@server:~/merb/merb-f$ sudo gem list | grep "dm-mysql-adapter"
dm-mysql-adapter (1.2.0)
4

2 回答 2

0

根本原因:某些数据库适配器配置错误。可能由 Merb 应用程序生成,或手动编辑。

将数据库适配器从 mysql 更改为 sqlite,它可以工作。

于 2012-10-24T07:37:21.847 回答
0

确保 Merb 知道您的GEM_PATH.

于 2012-05-09T14:17:58.407 回答