2014-12-28 9 views
6

Generierte Rails 4.2.0 App und Activecore-Postgis-Adapter hinzugefügt und die Datenbank.yml-Datei entsprechend bearbeitet.NameError: nicht initialisierte Konstante ActiveRecord :: ConnectionAdapters :: PostgreSQLAdapter :: TableDefinition

Aber jetzt, wenn ich rake db:create tun, bläst sie mit dem Fehler:

± 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) 

Antwort

6

Offenbar ist die activerecord-postgis-adapter gem not yet compatible with ActiveRecord 4.2 ist.

Verwenden Sie entweder den Standard-Edelstein pg (der von ActiveRecord nativ unterstützt wird) oder einen Downgrade auf 4.1.

+3

Letztes Update aus dem obigen Link ist, dass es eine Beta für Activerecord-postgis-Adapter, der dies behebt: gem „active-postgis-Adapter "," 3.0.0.beta1 " – ob1

0

Wie von ob1 im Kommentar der angenommenen Antwort darauf hingewiesen, hat der Postgis-Adapter zum Zeitpunkt dieses Beitrags eine Beta-Version, die ActiveRecord 4.2 unterstützt. Dies ist der Text aus dem Link von Simone Carletti zur Verfügung gestellt:

This branch is released as 3.0.0.beta1. Test with:

gem "activerecord-postgis-adapter", "3.0.0.beta1" There are significant changes to the PostgreSQL adapter in ActiveRecord 4.2, and it is extremely cumbersome to support prior versions in a single code base. Therefore, instead of having conditional support for prior versions of ActiveRecord, this adapter will only support ActiveRecord 4.2 and later in the master branch and version 3.0.

activerecord-postgis-adapter version 2.x will continue to support ActiveRecord 4.0 and 4.1.

activerecord-postgis-adapter version 3.x will support ActiveRecord 4.2 and later.

Verwandte Themen