How to setup Rails with MongoDB on Digital Ocean

February 20, 2016 2.9k views
Ruby on Rails MongoDB

I developed rails project and using Mongoid gem for using MongoDB on Rails project.

Everything going well on local, but I know nothing about how to setup on DigitalOcean.

I try to create One-click Apps droplet on Ruby on Rails on 14.04 (Postgres, Nginx, Unicorn). And put my project instead of default rails project and edit the working_directory in /etc/unicorn.conf point to my project.

Is there anything I have to config more ??

1 Answer

This tutorial covers all the basics of getting an application up and running on top of the DigitalOcean Ruby on Rails One-Click app:

It explains what is included and should point you in the right direction. There are a number of other places you would need to update besides /etc/unicorn.conf You need to update the path to your public folder in /etc/nginx/sites-enabled/rails as well as the APP_ROOT in /etc/default/unicorn Though both the One-Click and the tutorial use Postgres for the database. If you are not using Postgres, it might make more sense for you to set up your project on a clean Droplet in order to not run services that you have no need for.

by Melissa Anderson
ARCHIVED: DigitalOcean's Ruby on Rails One-click application provides a convenient way to get your Rails application running on an Ubuntu server. With Nginx, Unicorn, and Postgres all pre-installed, the One-click is a great base for hosting your app. In this tutorial, we'll show you how to create a Droplet, where to find the usernames and passwords, and how to restart the key services on the Droplet.
  • Thank you for your suggestion. I’ll try and give you a feedback if it work or not.

    About clean Droplet. Yeah, I used to try to create a clean Droplet but I know nothing, how to setup it. That’s why I change to use One-Click Application ,cause I think it’d be more easier, but I still cannot get it work.

    Is there any suggestion else for setup the environment for a clean Droplet?
    Thank you in advance.

Have another answer? Share your knowledge.