# Rake db:migrate gives error

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-gives-error/140587>\
**Category:** Rails\
**Created:** [June 16, 2008, 2:12pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-gives-error/140587 "2008-06-16T14:12:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [June 16, 2008, 2:12pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-gives-error/140587/1 "2008-06-16T14:12:09Z")

</div>

Hi,

when I am running rake db:migrate command on my application it gives  
me “undefined method `last’ for {}:Hash error”, how to resolve this  
error?

---

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [June 16, 2008, 2:26pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-gives-error/140587/2 "2008-06-16T14:26:36Z")

</div>

Sunny B. wrote:

> Hi,
> 
> when I am running rake db:migrate command on my application it gives  
> me “undefined method `last’ for {}:Hash error”, how to resolve this  
> error?

This is fairly impossible to resolve with no example…

What does the migration you’re trying to run look like?

---

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [June 16, 2008, 2:41pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-gives-error/140587/3 "2008-06-16T14:41:47Z")

</div>

Ar Chron wrote:

> Sunny B. wrote:
> 
> > Hi,
> > 
> > when I am running rake db:migrate command on my application it gives  
> > me “undefined method `last’ for {}:Hash error”, how to resolve this  
> > error?
> 
> This is fairly impossible to resolve with no example…
> 
> What does the migration you’re trying to run look like?

the error contain following code  
undefined method `last’ for {}:Hash  
E:/Aptana\_Projects/whitegold0.1/rakefile:10  
Currently I am using rails version 1.2.3,this cause due to rake file ?

---

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [June 16, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-gives-error/140587/4 "2008-06-16T15:50:52Z")

</div>

Maybe you have a bad install of rake? I’d try reinstalling the gem (I  
don’t use Aptana, so I can’t help with any specifics in that area).

And the earlier query was for what your migration code looked like… is  
there something in your self.up code that could be causing the issue?
