<p>RAILS_ENV is en environment variable. Environment variable is a setting which may be read inside the container. Though, environment variables do exist on most of the operating systems <a href="https://en.wikipedia.org/wiki/Environment_variable" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Environment_variable</a>
So the only specific here is that you can set an environment variable for the container and pass some values inside that way. </p>

<p>I assume you are working with docker-compose example for Ruby on Rails. So for the meaning of the RAILS_ENV value you should refer to the Ruby on Rails documentation <a href="https://guides.rubyonrails.org/configuring.html#rails-environment-settings" rel="nofollow noreferrer">https://guides.rubyonrails.org/configuring.html#rails-environment-settings</a></p>

CC BY-SA 4.0
2019-04-25T06:55:31.513Z
yeah i use docker compose for Ruby on Rials . so How does the change affect the automated build?  @Petr Chloupek
omar amine
CC BY-SA 4.0
2019-04-25T09:37:50.793Z
I don't think it should affect the build in any way. It is a runtime variable and it is set in the docker-compose which means it is set for the run time not for the build time. If you mean what it affects in the RoR application then it really depends on how you set the environment in the application https://richonrails.com/articles/creating-a-custom-rails-environment this is just a framework for giving the possibility to change settings based on where the application is running. Just open the sources and see what is there in your case.
petrchpetr
CC BY-SA 4.0
2019-04-21T20:53:24.870Z
2019-04-21T20:53:24.870Z
petrchpetr
<p>I have this <code>docker-compose.yml</code>:</p>

<pre><code>ports:
  - "3000:3000"
environment:
  RAILS_ENV: development
</code></pre>

<ul>
<li>What does the RAILS_ENV do?</li>
<li>What difference does it make, when RAILS_ENV is changed to development?</li>
<li>How does the change affect the automated build?</li>
</ul>

<ruby-on-rails>
What does the RAILS_ENV environment variable do in Ruby on Rails?
omar amine
# What does the RAILS_ENV environment variable do in Ruby on Rails?

(Asked by: username_0 on 2019-04-21)

I have this docker-compose.yml:
ports:
  - "3000:3000"
environment:
  RAILS_ENV: development


What does the RAILS_ENV do?
What difference does it make, when RAILS_ENV is changed to development?
How does the change affect the automated build?

**Tags:** ruby-on-rails


---

## 1 answers

### Answer by username_1 on 2019-04-21. Score: 1

RAILS\_ENV is en environment variable. Environment variable is a setting which may be read inside the container. Though, environment variables do exist on most of the operating systems <https://en.wikipedia.org/wiki/Environment_variable>
So the only specific here is that you can set an environment variable for the container and pass some values inside that way.

I assume you are working with docker-compose example for Ruby on Rails. So for the meaning of the RAILS\_ENV value you should refer to the Ruby on Rails documentation <https://guides.rubyonrails.org/configuring.html#rails-environment-settings>

> **Comments:**
> **username_0**: yeah i use docker compose for Ruby on Rials . so How does the change affect the automated build?  @Petr Chloupek  
> **username_1**: I don't think it should affect the build in any way. It is a runtime variable and it is set in the docker-compose which means it is set for the run time not for the build time. If you mean what it affects in the RoR application then it really depends on how you set the environment in the application https://richonrails.com/articles/creating-a-custom-rails-environment this is just a framework for giving the possibility to change settings based on where the application is running. Just open the sources and see what is there in your case.  

---

