# Rake aborted! You have a nil object when you didn't expect i

**URL:** <https://www.ruby-forum.com/t/rake-aborted-you-have-a-nil-object-when-you-didnt-expect-i/195395>\
**Category:** Deployment\
**Created:** [September 22, 2010, 4:36pm UTC](https://www.ruby-forum.com/t/rake-aborted-you-have-a-nil-object-when-you-didnt-expect-i/195395 "2010-09-22T16:36:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![muxstudycentre1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@muxstudycentre1](https://www.ruby-forum.com/u/muxstudycentre1)\
**Post date:** [September 22, 2010, 4:36pm UTC](https://www.ruby-forum.com/t/rake-aborted-you-have-a-nil-object-when-you-didnt-expect-i/195395/1 "2010-09-22T16:36:53Z")

</div>

i created one model called team so a migration is created and i  
edited the migration like this

class CreateTeams \< ActiveRecord::Migration  
def self.up  
create\_table :teams do |t|  
t.string :country  
t.string :group  
t.string :captain

```
  t.timestamps
end

```

end

def self.down  
drop\_table :teams  
end  
end

when i tried to rake

i am getting an issue like this

mathew@mathew mux]$ rake db:migrate  
(in /home/mathew/user/mux)  
rake aborted!  
You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occurred while evaluating nil.size

(See full trace by running task with --trace)  
[mathew@mathew mux]$ rake db:migrate  
(in /home/mathew/user/mux)  
rake aborted!  
You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occurred while evaluating nil.size

rake aborted! You have a nil object when you didn’t expect it! You might  
have expected an instance of Array. The error occurred while evaluating  
nil.size

i tried my leval best but not getting anything correct,any one can  
help???

---

<div class="post-metadata">

**Author:** ![muxstudycentre1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@muxstudycentre1](https://www.ruby-forum.com/u/muxstudycentre1)\
**Post date:** [October 12, 2010, 3:08pm UTC](https://www.ruby-forum.com/t/rake-aborted-you-have-a-nil-object-when-you-didnt-expect-i/195395/2 "2010-10-12T15:08:59Z")

</div>

your problem lies in the controller file and not in the migration one.  
please post the controller file for evaluation.
