Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8107653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:50:50+00:00 2026-06-06T00:50:50+00:00

Good afternoon, I’m having serious troubles getting my database back up and running. I

  • 0

Good afternoon,

I’m having serious troubles getting my database back up and running. I dropped my tables earlier this week (wanted to rebuild) and am having all kinds of problems.

I have done the following:

rake db:drop:all
rake db:create:all
rake db:migrate

I get the following error (will put full stack trace at the bottom):

PG::Error: ERROR:  relation "users" does not exist
LINE 4:              WHERE a.attrelid = '"users"'::regclass
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"users"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum

Authlogic is the issue here. The only reason I was able to see this error (the real error) was because I hid the authlogic error:

You must establish a database connection before using acts_as_authentic

As suggested in this post: Stack overflow thread

User migration:

class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string    :name,               :null => false
      t.string    :email,               :null => false
      t.string    :plan, :default => "basic"
      t.boolean   :verified, :default => false
      t.boolean   :admin, :default => false
      t.integer   :selected_portfolio_id
      t.datetime  :last_email_at
      t.hstore    :data

      t.string    :crypted_password,    :null => false
      t.string    :password_salt,       :null => false
      t.string    :persistence_token,   :null => false
      t.string    :perishable_token,    :null => false

      # magic fields (all optional, see Authlogic::Session::MagicColumns)
      t.integer   :login_count,         :null => false, :default => 0
      t.integer   :failed_login_count,  :null => false, :default => 0
      t.datetime  :last_request_at
      t.datetime  :current_login_at
      t.datetime  :last_login_at
      t.string    :current_login_ip
      t.string    :last_login_ip

      # optional, see Authlogic::Session::Params
      #t.string    :single_access_token, :null => false  
      t.timestamps
    end

    add_index :users, ["email"], :name => "index_users_on_email", :unique => true
    add_index :users, ["persistence_token"], :name => "index_users_on_persistence_token", :unique => true
  end
end

Why is authlogic trying to load up on a database migration? I’m assuming this has to be the problem…. Full stack trace:

/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/postgresql_adapter.rb:1151:in `async_exec'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/postgresql_adapter.rb:1151:in `exec_no_cache'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/postgresql_adapter.rb:664:in `block in exec_query'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/notifications/instrumenter.    rb:20:in `instrument'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `exec_query'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/postgresql_adapter.rb:1276:in `column_definitions'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/postgresql_adapter.rb:859:in `columns'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.    6/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in `yield'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in     `default'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in     `columns'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:248:in     `column_names'
/Users/brandon/Documents/authlogic/lib/authlogic/acts_as_authentic/base.rb:67:in `db_setup?'
/Users/brandon/Documents/authlogic/lib/authlogic/acts_as_authentic/base.rb:31:in `acts_as_authentic'
/Users/brandon/Dropbox/code/myapp/app/models/user_related/user.rb:14:in `<class:User>'
/Users/brandon/Dropbox/code/myapp/app/models/user_related/user.rb:1:in `<top (required)>'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in `load'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in     `block in load_file'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:639:in     `new_constants_in'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:468:in     `load_file'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:353:in     `require_or_load'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:502:in     `load_missing_constant'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:192:in     `block in const_missing'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in     `const_missing'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:229:in     `block in constantize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:228:in     `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:228:in     `constantize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/core_ext/string/inflections.    rb:54:in `constantize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activemodel-3.2.6/lib/active_model/observing.rb:189:in `block in     observe'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activemodel-3.2.6/lib/active_model/observing.rb:189:in `collect!'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activemodel-3.2.6/lib/active_model/observing.rb:189:in `observe'
/Users/brandon/Dropbox/code/myapp/app/models/user_related/user_observer.rb:2:in `<class:UserObserver>'
/Users/brandon/Dropbox/code/myapp/app/models/user_related/user_observer.rb:1:in `<top (required)>'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in `load'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in     `block in load_file'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:639:in     `new_constants_in'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:468:in     `load_file'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:353:in     `require_or_load'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:502:in     `load_missing_constant'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:192:in     `block in const_missing'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in     `const_missing'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:229:in     `block in constantize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:228:in     `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:228:in     `constantize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/core_ext/string/inflections.    rb:54:in `constantize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activemodel-3.2.6/lib/active_model/observing.rb:86:in     `instantiate_observer'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in `block in     instantiate_observers'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in     `instantiate_observers'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.6/lib/active_record/railtie.rb:117:in `block (2     levels) in <class:Railtie>'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in     `instance_eval'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in     `execute_hook'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:26:in     `block in on_load'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:25:in     `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:25:in     `on_load'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activerecord-3.2.6/lib/active_record/railtie.rb:116:in `block in <    class:Railtie>'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in     `call'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in     `execute_hook'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in     `block in run_load_hooks'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in     `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in     `run_load_hooks'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/application/finisher.rb:59:in `block in <    module:Finisher>'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `block in     run_initializers'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in     `method_missing'
/Users/brandon/Dropbox/code/myapp/config/environment.rb:5:in `<top (required)>'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in     `require'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in     `block in require'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in     `load_dependency'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in     `require'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/application.rb:103:in     `require_environment!'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@myapp/gems/railties-3.2.6/lib/rails/application.rb:292:in `block (2 levels) in     initialize_tasks'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/brandon/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/brandon/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/Users/brandon/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment

UPDATE 1

I was able to solve this problem by commenting out “acts as authentic”, migrating the database, then reapplying. While it is a bandaid, it doesn’t seem right. How can I properly fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:50:52+00:00Added an answer on June 6, 2026 at 12:50 am

    I had to do this to get it to work:

    Object.const_defined?("User")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good afternoon I'm hoping this is going to be nice and a simple f**k
Good afternoon, I'm having a problem with a section of code I'm working on
Good afternoon, I am having an issue with wordpress. I access to page123.domain.com and
Good afternoon to all, I have this scenario: I am using SQL Server 'BulkInsert'
Good afternoon all, I have a class which looks like this: public class Grapheme
Good Afternoon, I am having a hard time setting the navigational links to active
Good afternoon, I am having difficulties with libxml2. I tried to build the Perl
Good afternoon, I am having a little trouble with .net's internal (System.Drawing) based MetaFile
Good afternoon everybody! I have this threaded SerialPort wrapper that reads in a line
Good afternoon everyone, I am having an issue with a stored procedure inserting an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.