1

我刚刚在我的本地机器上安装了 Rails3 Bootstrap Device Cancan 并运行了rake spec,但我遇到了所有测试失败,并出现以下常见错误:

undefined local variable or method 'postgresql_version' for #<ActiveRecord::ConnectionAdaptors::SQLite3Adaptor:0x489dff8>

我不知道为什么我会得到这个,因为我https://github.com/RailsApps/rails3-bootstrap-devise-cancan仔细按照说明进行操作。

我目前在 Windows 8 上运行它并使用 Bitnami RubyStack 运行 CMD

4

2 回答 2

1

我遇到了同样的问题,这就是我解决它的方法。

看起来database_cleaner 1.1.0 版有问题。请参阅“database_cleaner >= 1.1.0 对于 SQLite 已损坏”(https://github.com/gregbell/active_admin/issues/2388)。我更新了我的 Gemfile 以设置

宝石'database_cleaner','< 1.1.0'

然后运行“捆绑安装”,完成后,“rake spec”运行干净。

于 2013-08-08T20:58:30.797 回答
0

仔细检查您的database.yml. 请参阅配置 Rails 应用程序,第 3.12 节,配置数据库

你打算使用 sqlite3 吗?sqlite3在你的吗Gemfile?自然SQLite3Adaptor不会回应postgresql_version!你能包括几行堆栈跟踪吗?

我怀疑这与设计或康康有关。

于 2013-08-07T08:01:28.287 回答