Report this

What is the reason for this report?

How to set Rails environment?

Posted on May 26, 2014

I have a 1-click installation of Ruby on Rails 4, NginX, and Ubuntu running on my droplet.

Unfortunately, I haven’t found a way to create my production database from my schema.rb file yet.

I think this is due to the fact that my Rails environment is still set to “development”. When I type “rake about” I get this:

Application root /home/rails Environment development Database adapter sqlite3

I would like to set my app to production mode, though. I would also like to use MySQL instead of SQLite.

How can this be done?

Typing “RAILS_ENV=production” seems to have no effect whatsoever.

Thanks for any help.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Good point. Have you found a solution to this yet?

This is pointless, how do we set the environment PERMANENTLY?

Yes, this is what I ended up doing (5 years after posting the initial question) and it seems to work.

More on rbenv-vars can be found here.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.