# Error with db:migrate

**URL:** <https://www.ruby-forum.com/t/error-with-db-migrate/101540>\
**Category:** Rails\
**Created:** [August 5, 2006, 10:11pm UTC](https://www.ruby-forum.com/t/error-with-db-migrate/101540 "2006-08-05T22:11:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 5, 2006, 10:11pm UTC](https://www.ruby-forum.com/t/error-with-db-migrate/101540/1 "2006-08-05T22:11:35Z")

</div>

I’m new to ROR, and am working my way through the Agile Web D.  
Book. In the test application, the authors tell me to test my database  
connection by performing “rake db:migrate”.

When I do, I get the error “Don’t know how to build task ‘db:migrate’”  
I’ve been looking around at the files, and I see a reference to a  
db/migrate directory (I’m running on Ubuntu Linux). My db directory is  
empty.

I’ve rechecked my steps several times, and I’ve followed instructions. I  
can connect to the database from MySQL (I’m running 4.1) using the  
configured user and password.

Can anyone offer some help? Remember that I’m new to ROR, so some of the  
things that seem obvious may not be to me.

Thanks in advance  
—Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 5, 2006, 10:23pm UTC](https://www.ruby-forum.com/t/error-with-db-migrate/101540/2 "2006-08-05T22:23:34Z")

</div>

Michael S. wrote:

> When I do, I get the error “Don’t know how to build task ‘db:migrate’”  
> I’ve been looking around at the files, and I see a reference to a  
> db/migrate directory (I’m running on Ubuntu Linux). My db directory is  
> empty.

Michael,

What happens if you go to the root directory of your project  
(…/rails-apps/myproject1 or something) and type:

rake --tasks

What happens?

Also, what happens when you type script/about or script/console.

-damon

> **[Damon Clinkscales](https://damonc.onuniverse.com/)**
>
> Damon Clinkscales

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 5, 2006, 10:38pm UTC](https://www.ruby-forum.com/t/error-with-db-migrate/101540/3 "2006-08-05T22:38:37Z")

</div>

Damon C. wrote:

> Michael S. wrote:
> 
> > When I do, I get the error “Don’t know how to build task ‘db:migrate’”  
> > I’ve been looking around at the files, and I see a reference to a  
> > db/migrate directory (I’m running on Ubuntu Linux). My db directory is  
> > empty.
> 
> Michael,
> 
> What happens if you go to the root directory of your project  
> (…/rails-apps/myproject1 or something) and type:
> 
> rake --tasks

I get the following:

michael@photon:~/ruby/rails/depot$ rake --tasks  
(in /home/michael/ruby/rails/depot)  
rake apidoc # Build the apidoc HTML Files  
rake appdoc # Build the appdoc HTML Files  
rake clear\_logs # Clears all \*.log files in log/  
rake clobber\_apidoc # Remove rdoc products  
rake clobber\_appdoc # Remove rdoc products  
rake clone\_structure\_to\_test # Recreate the test databases from the  
development structure  
rake db\_structure\_dump # Dump the database structure to a SQL  
file  
rake default # Run all the tests on a fresh test  
database  
rake doc # Generate API documentation, show coding  
stats  
rake environment # Require application environment.  
rake migrate # Migrate the database according to the  
migrate scripts in db/migrate (only supported on PG/MySQL). A specific  
version can be targetted with VERSION=x  
rake purge\_test\_database # Empty the test database  
rake reapidoc # Force a rebuild of the RDOC files  
rake reappdoc # Force a rebuild of the RDOC files  
rake recent # Run tests for  
recentclone\_structure\_to\_test  
rake stats # Report code statistics (KLOCs, etc) from  
the application  
rake test\_functional # Run tests for test\_functional  
rake test\_units # Run tests for test\_units

> What happens?
> 
> Also, what happens when you type script/about or script/console.

script/about is unknown; doesn’t exist.

script/console gives the following:

michael@photon:~/ruby/rails/depot$ script/console  
Loading development environment.

> >

> -damon  
> [http://damonclinkscales.com/](http://damonclinkscales.com/)

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 5, 2006, 10:48pm UTC](https://www.ruby-forum.com/t/error-with-db-migrate/101540/4 "2006-08-05T22:48:36Z")

</div>

Your version of Rails is quite old. The newest stable (1.1.2?) has a ton  
more tasks and uses the namespace syntax. You should install the newest  
version of Rails (probably just `gem install rails`) and try again.

Though you should see in that list the ‘migrate’ task, that’s the same  
thing as doing ‘db:migrate’ in newer Rails.

Jason

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 6, 2006, 3:52am UTC](https://www.ruby-forum.com/t/error-with-db-migrate/101540/5 "2006-08-06T03:52:31Z")

</div>

Michael S. wrote:

> Jason R. wrote:
> 
> > Your version of Rails is quite old. The newest stable (1.1.2?) has a ton  
> > more tasks and uses the namespace syntax. You should install the newest  
> > version of Rails (probably just `gem install rails`) and try again.
> 
> will do. Thanks for the help. I’m sure I’ll be back here as I progress.

Good deal. Jason’s got ya covered. Get yourself updated to 1.1 and  
your example should work just fine. Otherwise, use “migrate” instead of  
“db:migrate” as was suggested.

Best,  
-damon

> **[Damon Clinkscales](https://damonc.onuniverse.com/)**
>
> Damon Clinkscales

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 5, 2006, 10:56pm UTC](https://www.ruby-forum.com/t/error-with-db-migrate/101540/6 "2006-08-05T22:56:58Z")

</div>

Jason R. wrote:

> Your version of Rails is quite old. The newest stable (1.1.2?) has a ton  
> more tasks and uses the namespace syntax. You should install the newest  
> version of Rails (probably just `gem install rails`) and try again.

will do. Thanks for the help. I’m sure I’ll be back here as I progress.
