Question

How to deploy a Rails application from Github?

I want to import my app from github to run on Digitalocean. I am currently running Ubuntu Ruby on Rails on 14.04 (Postgres, Nginx, Unicorn).

Step I took so far after setting up a new droplet…

  1. sudo apt-get update
  2. I installed git
  3. removed the folder “/home/rails” and everything inside
  4. cloned the app from Github to “/home/”
  5. renamed the cloned folder to “rails”
  6. I setup the locale environment
  7. configured postgresql user and password
  8. bundle install everything
  9. run “rails s”

run into the problem

“A server is already running. Check /home/rails/tmp/pids/server.pid.” after I tried “rails s”

Is this the correct way to do it? if not how exactly should I go about deploying my rails app from github?

Subscribe
Share

Use GItDeploy Tool to automatic deployment from local to production server.


Submit an 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.

Sorry I don’t quite understand step 1. Can you explain more? create /home/index.html in app/view folder? how to point your route there?

ok i figured it out

  1. make sure to create /home/index.html as your first/index page and point your route there before you push to git
  2. install git apt-get install git
  3. ssh to your digitalocean domain
  4. navigate to cd /home/rails
  5. delete folder “rails”
  6. clone your rails repo from github git clone YOUR_REMOTE_ADDRESS
  7. rename the downloaded repo to rails mv OLD_FOLDER NEW_FOLDER
  8. setup your db rake db:drop db:create db:migrate
  9. run rails server like so rails s --binding=YOUR_IP_ADDRESS

I was running rails s for the past few days wondering why it is just showing the default “digitalocean rails page”, it was because i kept running rails by using rails s …duh

anyways, i hope this could help someone in the future.