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

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

@FilterKaapi

Description

@FilterKaapi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions