# How to determine if I am in development environment at runtime?

**URL:** <https://www.ruby-forum.com/t/how-to-determine-if-i-am-in-development-environment-at-runtime/185089>\
**Category:** Rails\
**Created:** [March 13, 2010, 11:02am UTC](https://www.ruby-forum.com/t/how-to-determine-if-i-am-in-development-environment-at-runtime/185089 "2010-03-13T11:02:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![k-b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/db5fbb/32.png) [@k-b](https://www.ruby-forum.com/u/k-b)\
**Post date:** [March 13, 2010, 11:02am UTC](https://www.ruby-forum.com/t/how-to-determine-if-i-am-in-development-environment-at-runtime/185089/1 "2010-03-13T11:02:17Z")

</div>

Hi!

I have something in my application which should be shown only if I am  
in development environment.

Is there a command or a global variable to determine the current  
environment of the application?

Greetings from Germany,  
Klaus

---

<div class="post-metadata">

**Author:** ![k-b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/db5fbb/32.png) [@k-b](https://www.ruby-forum.com/u/k-b)\
**Post date:** [March 13, 2010, 11:23am UTC](https://www.ruby-forum.com/t/how-to-determine-if-i-am-in-development-environment-at-runtime/185089/2 "2010-03-13T11:23:56Z")

</div>

On 13 March 2010 10:01, kb [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi!
> 
> I have something in my application which should be shown only if I am  
> in development environment.
> 
> Is there a command or a global variable to determine the current  
> environment of the application?

You can use  
if Rails.env.development?

Colin

---

<div class="post-metadata">

**Author:** ![k-b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/db5fbb/32.png) [@k-b](https://www.ruby-forum.com/u/k-b)\
**Post date:** [March 15, 2010, 2:37pm UTC](https://www.ruby-forum.com/t/how-to-determine-if-i-am-in-development-environment-at-runtime/185089/3 "2010-03-15T14:37:38Z")

</div>

Thank you!
