# Inconsistent specification of prod/dev environment

**URL:** <https://www.ruby-forum.com/t/inconsistent-specification-of-prod-dev-environment/131134>\
**Category:** Rails\
**Created:** [March 6, 2008, 11:03am UTC](https://www.ruby-forum.com/t/inconsistent-specification-of-prod-dev-environment/131134 "2008-03-06T11:03:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuktuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Post date:** [March 6, 2008, 11:03am UTC](https://www.ruby-forum.com/t/inconsistent-specification-of-prod-dev-environment/131134/1 "2008-03-06T11:03:05Z")

</div>

Is it just me (don’t just answer “yes” 🙂 - or is there an  
inconsistency in the way, that you specify the running environment for  
command-line Rails scricts?

If e.g. I want to run the console in production-mode, I would write:

script/console production

If running a migration, I need to write it like:

RAILS\_ENV=production rake db:migrate

I know, that “rake” is not a part of the Rails framework, but then why  
is there another convention for the console/server scripts?

- Carsten

---

<div class="post-metadata">

**Author:** ![tuktuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Post date:** [March 6, 2008, 11:05am UTC](https://www.ruby-forum.com/t/inconsistent-specification-of-prod-dev-environment/131134/2 "2008-03-06T11:05:40Z")

</div>

On 6 Mar 2008, at 10:03, Carsten G. wrote:

> RAILS\_ENV=production rake db:migrate
> 
> I know, that “rake” is not a part of the Rails framework, but then why  
> is there another convention for the console/server scripts?

You can write RAILS\_ENV=production script/console  
It’s just not very nice.

Fred

---

<div class="post-metadata">

**Author:** ![tuktuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Post date:** [March 6, 2008, 11:14am UTC](https://www.ruby-forum.com/t/inconsistent-specification-of-prod-dev-environment/131134/3 "2008-03-06T11:14:40Z")

</div>

Frederick C. wrote:

> You can write RAILS\_ENV=production script/console  
> It’s just not very nice.

Oh… I should have checked that before posting - sorry 🙂

I went the other way - I got used to using “script/console production”,  
and then later discovered that this didn’t work in “rake”.

- Carsten
