【问题标题】:Bootstrap Devise Cancan Rails - Rspec FailureBootstrap 设计 Cancan Rails - Rspec 失败
【发布时间】:2013-08-04 16:43:56
【问题描述】:

我刚刚在我的本地机器上安装了 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

【问题讨论】:

    标签: ruby-on-rails devise cancan bitnami railsapps


    【解决方案1】:

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

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

    gem 'database_cleaner', '

    然后运行“bundle install”,完成后,“rake spec”运行干净。

    【讨论】:

      【解决方案2】:

      仔细检查您的database.yml。参考Configuring Rails Applications, Section 3.12, Configuring a Database

      你打算使用 sqlite3 吗? sqlite3 在您的 Gemfile 中吗?当然SQLite3Adaptor不会回复postgresql_version!能否再添加几行堆栈跟踪信息?

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-02-11
        • 1970-01-01
        • 2013-08-08
        • 1970-01-01
        • 2011-10-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多