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 4614380
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:41:30+00:00 2026-05-22T01:41:30+00:00

I am installing the devise gem for authentication in a Ruby on Rails application

  • 0

I am installing the devise gem for authentication in a Ruby on Rails application and I ran the database migration like this:

rake db:migrate

and got this error:

undefined method `reference' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x9322248>

This is a bit cryptic. Where should I go to debug this and what could the problem be?

The only non-standard thing I did was give it the table name “users” which is my table name in this previous command: rails generate devise users

Also, my routes.rb file has this new entry:

devise_for :users

Probably the issue is mis-matched columns in my database and what the auth package thinks the users table should be like. Where do I look to see what the auth package thinks the columns are like? And where do I find where the create-table command is for the users table that I have. It was made with the scaffold command originally which put a whole bunch of extra and useless things in my system.

My db/migrate/users/create_users file looks like this:

class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |t|

      t.timestamps
    end
  end

  def self.down
    drop_table :users
  end
end

Which is basic, but my users table in the db has these columns:

+------------------+------------------+------+-----+---------+-------+
| Field            | Type             | Null | Key | Default | Extra |
+------------------+------------------+------+-----+---------+-------+
| uid              | int(10) unsigned | NO   | PRI | 0       |       |
| name             | varchar(60)      | NO   | UNI |         |       |
| pass             | varchar(128)     | NO   |     |         |       |
| mail             | varchar(254)     | YES  | MUL |         |       |
| theme            | varchar(255)     | NO   |     |         |       |
| signature        | varchar(255)     | NO   |     |         |       |
| signature_format | varchar(255)     | YES  |     | NULL    |       |
| created          | int(11)          | NO   | MUL | 0       |       |
| access           | int(11)          | NO   | MUL | 0       |       |
| login            | int(11)          | NO   |     | 0       |       |
| status           | tinyint(4)       | NO   |     | 0       |       |
| timezone         | varchar(32)      | YES  |     | NULL    |       |
| language         | varchar(12)      | NO   |     |         |       |
| picture          | int(11)          | NO   |     | 0       |       |
| init             | varchar(254)     | YES  |     |         |       |
| data             | longblob         | YES  |     | NULL    |       |
+------------------+------------------+------+-----+---------+-------+

And I am not sure how such an inconsistency can exist after I run the migrate command. Where does it take instructions from if not the above file I posted?

Thanks!

  • 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-05-22T01:41:31+00:00Added an answer on May 22, 2026 at 1:41 am

    I suggest you run the db:migrate command with the –trace option:

    rake db:migrate --trace
    

    As an example, I purposely added a syntax error in my devise migration and this is a fragment of the output I got. As you can see, the –trace option should point you to the exact error (migration file + line #).

        undefined method `strin' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x00000106c5ea98>
        /Users/#####/.rvm/gems/ruby-1.9.2-p136@rails3/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/schema_definitions.rb:326:in `method_missing'
        /Users/#####/rails/$$$$$$/db/migrate/20101031153010_devise_create_users.rb:13:in `block in up'
        /Users/#####/.rvm/gems/ruby-1.9.2-p136@rails3/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:157:in `create_table'
    ...
    

    Note that your migration files are located under the db/migrate directory. So given the above error, I would need to open up the db/migrate/20101031153010_devise_create_users.rb migration file and fix the error on line 13.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Installing Merb on Ruby Enterprise Edition (OS X) throws this error, any ideas? sudo
When installing subversion as a service, I used this command: c:\>svnservice -install --daemon --root
After installing the VSTS Database GDR and importing a SQL Server 2005 database that
what this error mean, when i am installing the app on device,i am getting
Installing my software on Windows XP was always easy. Everything went in the c:\Program
After installing VS2008, the platform builder mod, and the WM7 aku, VS usually prompts
After installing VMware Server I get the following error when I try to access
After installing Oracle XE, something in Oracle is listening on port 8080. I am
when installing SQLServer2005 developer edition (not express) I created a named instance: MYSERVERNAME/MYINSTANCENAME Is
When installing one of JRuby's frequent upgrades, I need to re-install my gems, as

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.