# Can't prepare test database

**URL:** <https://www.ruby-forum.com/t/cant-prepare-test-database/135102>\
**Category:** Rails\
**Created:** [April 17, 2008, 10:05pm UTC](https://www.ruby-forum.com/t/cant-prepare-test-database/135102 "2008-04-17T22:05:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [April 17, 2008, 10:05pm UTC](https://www.ruby-forum.com/t/cant-prepare-test-database/135102/1 "2008-04-17T22:05:06Z")

</div>

Hi,

I got a production server where I’d like to run “rake test” - to check  
for file permissions etc. - all tests pass on my local machine.

On the production server I got production db and empty development and  
test db. How to create schema.rb file and prepare test db? I tried  
various rake tasks, but the schema definition in schema.rb file is  
empty and despite the fact that rake tasks (i.e. db:test:prepare and  
db:schema:dump) do not return any errors, I can’t create test db  
structure and run tests.

Thanks in advance for any tips

---

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [April 18, 2008, 1:03am UTC](https://www.ruby-forum.com/t/cant-prepare-test-database/135102/2 "2008-04-18T01:03:52Z")

</div>

szimek wrote:

> structure and run tests.
> 
> Thanks in advance for any tips
> 
> >

Try this…

rake RAILS\_ENV=development db:migrate  
rake db:test:prepare

–

[http://www.5valleys.com/](http://www.5valleys.com/)

[http://www.workingwithrails.com/person/8078](http://www.workingwithrails.com/person/8078)

---

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [April 20, 2008, 12:14pm UTC](https://www.ruby-forum.com/t/cant-prepare-test-database/135102/3 "2008-04-20T12:14:47Z")

</div>

On 18 Kwi, 01:02, Jon G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > db:schema:dump) do not return any errors, I can’t create test db
> 
> [http://www.5valleys.com/](http://www.5valleys.com/)
> 
> [http://www.workingwithrails.com/person/8078](http://www.workingwithrails.com/person/8078)

Thanks!
