Bootstrap Devise Cancan Rails - Rspec Failure

184 Views Asked by At

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:

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.

I'm currently running this on Windows 8 and used Bitnami RubyStack to run CMD

2

There are 2 best solutions below

0
On

Double-check your database.yml. Refer to Configuring Rails Applications, Section 3.12, Configuring a Database.

Did you intend to use sqlite3? Is sqlite3 in your Gemfile? Naturally, SQLite3Adaptor will not respond to postgresql_version! Can you include a few more lines of the stack trace?

I doubt this has anything to do with devise or cancan.

0
On

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. See "database_cleaner >= 1.1.0 is broken for SQLite" (https://github.com/gregbell/active_admin/issues/2388). I updated my Gemfile to set

gem 'database_cleaner', '< 1.1.0'

then ran "bundle install" and after it completed, "rake spec" ran cleanly.