0
votes

I did my first deploy with a very simple rails app today on a Digital Ocean droplet running Ubuntu 14.04. I deployed following this article

https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma

and only replaced RVM with rbenv. Now I get the "We're sorry, but something went wrong." Rails error page. My production.log says the following:

D, [2016-02-13T15:58:41.165515 #1783] DEBUG -- :   ^[[1m^[[36mActiveRecord::SchemaMigration Load (1.5ms)^[[0m  ^[[1mSELECT "schema_migrations".* FROM "schema_migrations"^[[0m

Puma logs are clean though. I had some trouble with rake in the first place, as migrations weren't executed by capistrano itself. So I updated rake from 10.4.2 to 10.5 and executed the migrations manually, but still the same error. Thanks in advance.

EDIT:

What I just noticed is that my public folder looks like this:

404.html  422.html  500.html  assets  favicon.ico  robots.txt

As this is nginx' root folder, how is the app supposed to load in any way? As I said, this is my first deploy.

2
Looks like your Rails app has no problem starting up; the logs are clean. Probably there is trouble with Nginx forwarding to Puma. Can you show us your Nginx logs (in /var/log/nginx/, and if possible, the relevant parts of your Nginx config? - Matt Brictson

2 Answers

1
votes

Puma logs are clean, but I bet Rails ones aren't. They're located under RAILS_ROOT/log directory, you probably want the production one.

My guess, without seeing those logs are that it's one of the following, ordered by likelihood:

  1. You do not have a secret token generated which is done using rake secret and placing it in an environment variable. Check config/secrets.yml.
  2. Bad database connection
  3. Ruby environment is wrong, a certain gem is missing

It should be one of these three things. Check the log file first, though and maybe post it as an edit

0
votes

Rails is letting you know that migrations need to be run by trying to load the schema so:

RAILS_ENV=production rake db:migrate assets:precompile