Question: how do I change environments in ruby on rails

Question

how do I change environments in ruby on rails

Answers 2
Added at 2017-01-02 13:01
Tags
Question

At the moment, I am unable to run my server because apparently I seem to be in the wrong environment.

Suppose I am in the test environment, how do I switch to the production environment? Because right now, every time I am trying to run my app they keep telling me the server is running on the production environment.When I check to see if its running it still says that no application is running....

Is there a command I can use to switch environments?

Answers
nr: #1 dodano: 2017-01-02 14:01

Set the RAILS_ENV to production

RAILS_ENV=production rails s
nr: #2 dodano: 2017-01-02 14:01

I think you should try

rails server -e production
rails s -e production

This command will work from rails3 or later

Source Show
◀ Wstecz