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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:12:12+00:00 2026-05-12T21:12:12+00:00

I am trying to run an active record migration but am receiving the following

  • 0

I am trying to run an active record migration but am receiving the following error:

undefined method ‘info’ for nil:NilClass

Here is the 2 lines of code in my rake task that runs the migration

ActiveRecord::Base.establish_connection(YAML::load(File.open('src/SupporterSync.Core/Database/Database.yml')))
ActiveRecord::Migrator.migrate('src/SupporterSync.Core/Database/Migrations', ENV["VERSION"] ? ENV["VERSION"].to_i : nil )

And here is my only migration class in the folder

class InitialMigration < ActiveRecord::Migration
  def self.up
    create_table :Accounts, :primary_key => :Id do |t|
      t.string :ListId, :limit => 36, :null => false
      t.string :Name, :limit => 31, :null => false
      t.string :FullName, :limit => 31, :null => false
      t.string :ParentListId, :limit => 36
    end
  end
  def self.down
    drop_table :Accounts
  end
end

And here is the trace statement:

** Invoke migrate (first_time)
** Execute migrate
rake aborted!
undefined method info' for nil:NilClass<br />
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
:473:in
migrate’
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
:472:in each'<br />
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
:472:in
migrate’
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
:400:in up'<br />
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
:383:in
migrate’
E:/Working/Code/WMF/SupporterSync/rakefile.rb:19
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in call'<br
/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
execute’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in each'<br
/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
execute’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
invoke_with_call_c hain'<br /> C:/Ruby/lib/ruby/1.8/monitor.rb:242:in
synchronize’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
invoke_with_call_c hain'<br />
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
invoke’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
invoke_task'<br />
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
each'<br />
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exceptio n_handling'<br />
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
top_level’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in run'<br
/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exceptio n_handling’
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in run'<br
/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31<br />
C:/Ruby/bin/rake:19:in
load’
C:/Ruby/bin/rake:19

  • 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-12T21:12:12+00:00Added an answer on May 12, 2026 at 9:12 pm

    I suggest following Rails’ conventions and making your table + field names lowercase_and_underscored rather than CamelCasing. Some macros such as belongs_to look for the lowercase variants and by using them you make your life a lot easier. I’m sorry this does not quite answer your question.

    Also, the primary key is “id” by default, so you don’t need to set it.

    Thirdly, migrations are usually run with rake db:migrate.

    Lastly, the reason you’re getting that error is that you’re setting up ActiveRecord::Base and not defining a logger object on it, like Rails does for you when you run any task descending from :environment. For more information, see this line in the Rails source.

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

Sidebar

Related Questions

No related questions found

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.