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

  • Home
  • SEARCH
  • 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 7734639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:17:59+00:00 2026-06-01T07:17:59+00:00

So I’m really new to Rails, and I’m getting a strange error that I

  • 0

So I’m really new to Rails, and I’m getting a strange error that I don’t understand. I created an Event model and I want to migrate it to my database. However, when I run bundle exec rake db:migrate --trace this is what I get:

05:55 PM movienights: bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
==  CreateEvents: migrating ===================================================
-- create_table(:events)
rake aborted!
An error has occurred, all later migrations canceled:

    undefined method `name' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007ffa75a27660>
    Documents/Homework/College/2011-2012/Rails/RailsApps/movienights/db/migrate/20120331213639_create_events.rb:4:in `block in change'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:160:in `create_table'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:432:in `create_table'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:450:in `block in method_missing'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:424:in `block in say_with_time'
    .rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/benchmark.rb:295:in `measure'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:424:in `say_with_time'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:444:in `method_missing'
    Documents/Homework/College/2011-2012/Rails/RailsApps/movienights/db/migrate/20120331213639_create_events.rb:3:in `change'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:393:in `block (2 levels) in migrate'
    .rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/benchmark.rb:295:in `measure'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:393:in `block in migrate'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:118:in `with_connection'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:377:in `migrate'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:512:in `migrate'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:704:in `block (2 levels) in migrate'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:761:in `call'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:761:in `ddl_transaction'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:703:in `block in migrate'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:684:in `each'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:684:in `migrate'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:554:in `up'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/migration.rb:535:in `migrate'
    .rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.2/lib/active_record/railties/databases.rake:153:in `block (2 levels) in <top (required)>'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
    .rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
    .rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
    .rvm/gems/ruby-1.9.2-p318/bin/rake:19:in `load'
    .rvm/gems/ruby-1.9.2-p318/bin/rake:19:in `<main>'
    Tasks: TOP => db:migrate

When I run bundle exec rake, I get:

You have 1 pending migrations:
  20120331213639 CreateEvents
Run `rake db:migrate` to update your database then try again.

My Create events migration is:

class CreateEvents < ActiveRecord::Migration
  def change
    create_table :events do |t|
      t.name :string
      t.date :datetime
      t.location :string

      t.timestamps
    end
  end
end

However, I deleted the Event model using rails destroy scaffold Event and made it again with different properties. Could this be part of the problem?

Any help or suggestions are much appreciated!

  • 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-01T07:18:00+00:00Added an answer on June 1, 2026 at 7:18 am

    Wrong order on declaring attributes in the migration. It should be :

    t.string :name
    

    The same for your other attributes. Also rename the date attribute to something else, because it is a preserved key name that you should never use.

    It seems that you probably run the generator like ‘string:name’ instead of the correct ‘name:string’ 🙂

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a

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.