1

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

Daniel Kehoe
  • 10,952
  • 6
  • 63
  • 82
Passionate Engineer
  • 10,034
  • 26
  • 96
  • 168

2 Answers2

1

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.

user2665949
  • 307
  • 3
  • 7
0

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.

Jared Beck
  • 16,796
  • 9
  • 72
  • 97