title: undefined method 'info' for nil:NilClass when running active record migration
body: <p>I am trying to run an active record migration but am receiving the following error:</p>
  
  <blockquote>
    <p>undefined method 'info' for nil:NilClass</p>
  </blockquote>
  
  <p>Here is the 2 lines of code in my rake task that runs the migration</p>
  
  <pre><code>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 )
  </code></pre>
  
  <p>And here is my only <strong>migration class</strong> in the folder</p>
  
  <pre><code>class InitialMigration &lt; ActiveRecord::Migration
    def self.up
      create_table :Accounts, :primary_key =&gt; :Id do |t|
        t.string :ListId, :limit =&gt; 36, :null =&gt; false
        t.string :Name, :limit =&gt; 31, :null =&gt; false
        t.string :FullName, :limit =&gt; 31, :null =&gt; false
        t.string :ParentListId, :limit =&gt; 36
      end
    end
    def self.down
      drop_table :Accounts
    end
  end
  </code></pre>
  
  <p>And here is the <strong>trace statement</strong>:</p>
  
  <blockquote>
    <p>** Invoke migrate (first_time)<br />
    ** Execute migrate<br /> rake aborted!<br /> undefined method <code>info' for nil:NilClass&lt;br /&gt;
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
    :473:in</code>migrate'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
    :472:in <code>each'&lt;br /&gt;
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
    :472:in</code>migrate'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
    :400:in <code>up'&lt;br /&gt;
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
    :383:in</code>migrate'<br />
    E:/Working/Code/WMF/SupporterSync/rakefile.rb:19<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in <code>call'&lt;br
    /&gt; C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
    </code>execute'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in <code>each'&lt;br
    /&gt; C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
    </code>execute'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
    <code>invoke_with_call_c hain'&lt;br /&gt; C:/Ruby/lib/ruby/1.8/monitor.rb:242:in
    </code>synchronize'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
    <code>invoke_with_call_c hain'&lt;br /&gt;
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
    </code>invoke'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
    <code>invoke_task'&lt;br /&gt;
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
    </code>top_level'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
    <code>each'&lt;br /&gt;
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
    </code>top_level'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
    <code>standard_exceptio n_handling'&lt;br /&gt;
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
    </code>top_level'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in <code>run'&lt;br
    /&gt; C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
    </code>standard_exceptio n_handling'<br />
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in <code>run'&lt;br
    /&gt; C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31&lt;br /&gt;
    C:/Ruby/bin/rake:19:in</code>load'<br /> C:/Ruby/bin/rake:19<br /></p>
  </blockquote>