# Define environment for rake db:seed

**URL:** <https://www.ruby-forum.com/t/define-environment-for-rake-db-seed/188857>\
**Category:** Rails\
**Created:** [May 19, 2010, 2:15pm UTC](https://www.ruby-forum.com/t/define-environment-for-rake-db-seed/188857 "2010-05-19T14:15:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reggieb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Post date:** [May 19, 2010, 2:15pm UTC](https://www.ruby-forum.com/t/define-environment-for-rake-db-seed/188857/1 "2010-05-19T14:15:30Z")

</div>

How do you define which version of the database is populated via the new  
default seed process? Running this:

rake db:seed

runs the code in seed.rb in the development environment and therefore  
loads the seed data into the development database.

What is the syntax to use seed to populate the production database?

---

<div class="post-metadata">

**Author:** ![reggieb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Post date:** [May 19, 2010, 3:27pm UTC](https://www.ruby-forum.com/t/define-environment-for-rake-db-seed/188857/2 "2010-05-19T15:27:18Z")

</div>

rake db:seed RAILS\_ENV=production

---

<div class="post-metadata">

**Author:** ![reggieb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Post date:** [May 19, 2010, 3:35pm UTC](https://www.ruby-forum.com/t/define-environment-for-rake-db-seed/188857/3 "2010-05-19T15:35:56Z")

</div>

tshim wrote:

> rake db:seed RAILS\_ENV=production

Thank you.
