Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NameError: uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition

Generated rails 4.2.0 app and added activerecord-postgis-adapter and edited the database.yml file accordingly.

But now when I do rake db:create, it blows with the error:

± be rake db:create                                                                                                         2.1.0
rake aborted!
NameError: uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition
/Users/millisami/Railsapps/showme/config/application.rb:16:in `<top (required)>'
/Users/millisami/Railsapps/showme/Rakefile:4:in `require'
/Users/millisami/Railsapps/showme/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
like image 798
Autodidact Avatar asked Dec 28 '14 13:12

Autodidact


2 Answers

Apparently, the activerecord-postgis-adapter gem is not yet compatible with ActiveRecord 4.2.

Either use the standard pg gem (that is supported natively by ActiveRecord), or downgrade to 4.1.

like image 172
Simone Carletti Avatar answered Nov 15 '22 05:11

Simone Carletti


Version 3.0.0 of activerecord-postgis-adapter has been released. It supports ActiveRecord 4.2.

gem "activerecord-postgis-adapter"

https://github.com/rgeo/activerecord-postgis-adapter

https://rubygems.org/gems/activerecord-postgis-adapter

like image 25
tee Avatar answered Nov 15 '22 04:11

tee