Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Uninitialized constant ActiveRecord::Coders::Hstore (NameError) #106

Open
FilterKaapi opened this issue Jun 24, 2013 · 4 comments
Open

Uninitialized constant ActiveRecord::Coders::Hstore (NameError) #106

FilterKaapi opened this issue Jun 24, 2013 · 4 comments

Comments

@FilterKaapi
Copy link

I have a Rails 3.2.11 app to which I tried adding Postgres Hstore using the activerecord-postgres-hstore gem. The app works find in development with PG-9.1.9 db, but gives the following error in the production server with PG-9.1.8 db:uninitialized constant ActiveRecord::Coders::Hstore (NameError)

The log files are as follows:

unicorn.log

E, [2013-06-24T18:48:27.379430 #901] ERROR -- : reaped #<Process::Status: pid 16706 exit 1> worker=1
I, [2013-06-24T18:48:27.379703 #901]  INFO -- : worker=1 spawning...
I, [2013-06-24T18:48:27.385576 #16719]  INFO -- : worker=1 spawned pid=16719
I, [2013-06-24T18:48:27.385854 #16719]  INFO -- : Refreshing Gem list
E, [2013-06-24T18:48:27.391198 #901] ERROR -- : reaped #<Process::Status: pid 16708 exit 1> worker=0
I, [2013-06-24T18:48:27.391379 #901]  INFO -- : worker=0 spawning...
I, [2013-06-24T18:48:27.392775 #16722]  INFO -- : worker=0 spawned pid=16722
I, [2013-06-24T18:48:27.392991 #16722]  INFO -- : Refreshing Gem list
E, [2013-06-24T18:48:29.235072 #16712] ERROR -- : uninitialized constant ActiveRecord::Coders::Hstore (NameError)
/home/slaxman/apps/itextbook/releases/20130624183910/app/models/book.rb:7:in `<class:Book>'
/home/slaxman/apps/itextbook/releases/20130624183910/app/models/book.rb:5:in `<top (required)>'
/home/slaxman/apps/itextbook/releases/20130624183910/app/admin/books.rb:1:in `<top (required)>'

production.log

Connecting to database specified by database.yml

book.rb

class Book < ActiveRecord::Base

    serialize :properties , ActiveRecord::Coders::Hstore
    serialize :bookmark_count , ActiveRecord::Coders::Hstore

    attr_accessible :title, :content, :input_method, :bookmarks_attributes, :bookmark_count, :properties


    has_many :bookmarks
    accepts_nested_attributes_for :bookmarks, allow_destroy: true
end
@joevandyk
Copy link

Seeing this as well.

@cadicallegari
Copy link

I have managed to solve the problem by updating postgres to 9.3

@kofronpi
Copy link

kofronpi commented Jul 7, 2014

Same problem with Rails 4.1.4 and Postgres 9.1.13

@diogob
Copy link
Owner

diogob commented Jul 7, 2014

@kofronpi in Rails 4.1.4 hstore support is native to ActiveRecord.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants