简体   繁体   English

Bootstrap Devise Cancan Rails-Rspec失败

[英]Bootstrap Devise Cancan Rails - Rspec Failure

I just installed Rails3 Bootstrap Device Cancan in my local machine and ran rake spec but I'm getting all test failures with below error in common: 我刚刚在我的本地计算机上安装了Rails3 Bootstrap Device Cancan并运行了rake spec但是我遇到了所有测试失败,但常见错误如下:

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

I'm not sure why I'm getting this since I followed the instructions on https://github.com/RailsApps/rails3-bootstrap-devise-cancan carefully. 我不确定为什么要得到这个,因为我认真遵循了https://github.com/RailsApps/rails3-bootstrap-devise-cancan上的指示。

I'm currently running this on Windows 8 and used Bitnami RubyStack to run CMD 我目前正在Windows 8上运行此程序,并使用Bitnami RubyStack运行CMD

I ran into the same problem and this is how I resolved it. 我遇到了同样的问题,这就是我解决的方法。

It looks like there is a problem with version 1.1.0 of database_cleaner. 看来database_cleaner的1.1.0版本有问题。 See "database_cleaner >= 1.1.0 is broken for SQLite" ( https://github.com/gregbell/active_admin/issues/2388 ). 请参阅“ SQLite的database_cleaner> = 1.1.0已损坏”( https://github.com/gregbell/active_admin/issues/2388 )。 I updated my Gemfile to set 我更新了Gemfile进行设置

gem 'database_cleaner', '< 1.1.0' gem'database_cleaner','<1.1.0'

then ran "bundle install" and after it completed, "rake spec" ran cleanly. 然后运行“捆绑安装”,完成后,“ rake spec”运行干净。

Double-check your database.yml . 仔细检查您的database.yml Refer to Configuring Rails Applications, Section 3.12, Configuring a Database . 请参阅配置Rails应用程序,第3.12节,配置数据库

Did you intend to use sqlite3? 您打算使用sqlite3吗? Is sqlite3 in your Gemfile ? sqlite3是否在您的Gemfile Naturally, SQLite3Adaptor will not respond to postgresql_version ! 当然, SQLite3Adaptor将不会响应postgresql_version Can you include a few more lines of the stack trace? 您能否再增加几行堆栈跟踪?

I doubt this has anything to do with devise or cancan. 我怀疑这与设计或康康舞有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM