Rails 3.1 RC6 PG schema issue with cache_classes

48 views
Skip to first unread message

jgelo

unread,
Aug 27, 2011, 1:48:36 AM8/27/11
to rubyonra...@googlegroups.com
I've got a PostgreSQL DB setup using schemas and I'm running into an issue when config.cache_classes = true (ie, in production mode only and not in development mode).

Attempting to start the console or webrick in production fails outright because the postgresql adapter can't find my tables .. they don't exist in the default public schema and the search path is not set until a request comes in.  This isn't an issue under Rails 3.0.  Here's the topmost error -

/home/jgelo/.rvm/gems/ruby-1.9.3-preview1/gems/activerecord-3.1.0.rc6/lib/active_record/connection_adapters/postgresql_adapter.rb:962:in `async_exec': PGError: ERROR:  relation "entities" does not exist (ActiveRecord::StatementInvalid)

Just wanted to check if anyone has run into this or had any ideas before submitting a report.

jgelo

unread,
Sep 11, 2011, 9:14:29 PM9/11/11
to rubyonra...@googlegroups.com
Just a quick followup on this, I wasn't able to reproduce the issue with a new 3.1 app and haven't had a chance to track down the root cause .. but some requires/dependencies are pulling in a bunch of my models during init.  To get around the problem I created an empty stub schema and set schema_search_path in database.yml to it so the table info can always be accessed.
Reply all
Reply to author
Forward
0 new messages