Rails App Deployment: We're sorry, but something went wrong

August 11, 2014 9.9k views

I followed the steps in this tutorial in setting up my rails app in the production environemnt:
https://www.digitalocean.com/community/tutorials/how-to-1-click-install-ruby-on-rails-on-ubuntu-12-10-with-digitalocean

I set up postgresql as my production database, and restarted the server

but as I went to my browser and typed in 107.170.173.62
it gave me the error page: "We're sorry, but something went wrong."

I looked then in my unicorn.log file, but there's nothing abnormal logged. Below is the content from the log file, in its entirety

unicorn.log:

I, [2014-08-10T19:40:49.559975 #5583] INFO -- : Writing /home/rails/public/assets/fonts/FontAwesome-6b13d75d9c413fb0f54261779a75d1d4.otf 
I, [2014-08-10T19:40:49.570159 #5583] INFO -- : Writing /home/rails/public/assets/fonts/fontawesome-webfont-7f212c758dd8aadfa80034ca87415400.eot 
I, [2014-08-10T19:40:49.586721 #5583] INFO -- : Writing /home/rails/public/assets/fonts/fontawesome-webfont-7ea9196e832f05fbaafaa3d6b75af57e.svg 
I, [2014-08-10T19:40:49.591512 #5583] INFO -- : Writing /home/rails/public/assets/fonts/fontawesome-webfont-5c08577fd3668ef019ded8f88ea4b100.ttf 
I, [2014-08-10T19:40:49.596329 #5583] INFO -- : Writing /home/rails/public/assets/fonts/fontawesome-webfont-53a7c4113fd1a61db61bba7fea2889f9.woff 
I, [2014-08-10T19:40:49.599416 #5583] INFO -- : Writing /home/rails/public/assets/glyphicons-halflings-regular-147f3f6e098736e89ffab2c15cfbef06.eot 
I, [2014-08-10T19:40:49.653750 #5583] INFO -- : Writing /home/rails/public/assets/glyphicons-halflings-regular-777bc40741c377d9f064d1ed31041f79.svg 
I, [2014-08-10T19:40:49.658727 #5583] INFO -- : Writing /home/rails/public/assets/glyphicons-halflings-regular-38ab34013ba10653660d52a9cf85d53e.ttf 
I, [2014-08-10T19:40:49.661073 #5583] INFO -- : Writing /home/rails/public/assets/glyphicons-halflings-regular-41eac767e76e3241f42674b78614369e.woff 
I, [2014-08-10T19:40:49.665979 #5583] INFO -- : Writing /home/rails/public/assets/rails-fa9f1211ef7060256da6b709d182b850.png 
I, [2014-08-10T19:40:54.655123 #5583] INFO -- : Writing /home/rails/public/assets/application-cb971461d7fae120378ae46a3ab4dbd3.js 
I, [2014-08-10T19:40:54.798935 #5583] INFO -- : Writing /home/rails/public/assets/application-aa644992b71bc9cca8e330c18b3f749a.css

Below are the content from my nginx logs:

access.log

107.22.80.231 - - [10/Aug/2014:14:23:25 +0000] "HEAD / HTTP/1.1" 500 0 "-" "Cloud mapping experiment. Contact research@pdrlabs.net" 
107.22.80.231 - - [10/Aug/2014:14:23:25 +0000] "GET /clientaccesspolicy.xml HTTP/1.1" 500 1266 "-" "Cloud mapping experiment. Contact research@pdrlabs.net" 
100.33.146.15 - - [10/Aug/2014:19:41:48 +0000] "GET / HTTP/1.1" 500 1266 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" 
100.33.146.15 - - [10/Aug/2014:19:41:49 +0000] "GET /favicon.ico HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" 
100.33.146.15 - - [10/Aug/2014:19:44:43 +0000] "GET / HTTP/1.1" 500 1266 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" 
100.33.146.15 - - [10/Aug/2014:19:49:44 +0000] "GET / HTTP/1.1" 500 1266 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" 
162.243.14.86 - - [10/Aug/2014:20:02:41 +0000] "GET / HTTP/1.1" 500 1266 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36" 
162.243.14.86 - - [10/Aug/2014:20:02:42 +0000] "GET /favicon.ico HTTP/1.1" 200 0 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"

access.log.1:

23.22.13.205 - - [09/Aug/2014:11:44:12 +0000] "HEAD / HTTP/1.1" 200 0 "-" "Cloud mapping experiment. Contact research@pdrlabs.net" 
23.22.13.205 - - [09/Aug/2014:11:44:12 +0000] "GET /clientaccesspolicy.xml HTTP/1.1" 404 1351 "-" "Cloud mapping experiment. Contact research@pdrlabs.net" 
193.95.16.116 - - [09/Aug/2014:13:31:27 +0000] "GET /manager/html HTTP/1.1" 404 650 "-" "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0" 
108.162.222.87 - - [09/Aug/2014:22:48:39 +0000] "GET /robots.txt HTTP/1.1" 200 177 "-" "nutch-1.4/Nutch-1.4" 
173.245.62.85 - - [09/Aug/2014:22:48:39 +0000] "GET / HTTP/1.1" 200 661 "-" "nutch-1.4/Nutch-1.4" 
107.22.67.189 - - [10/Aug/2014:01:01:58 +0000] "HEAD / HTTP/1.1" 200 0 "-" "Cloud mapping experiment. Contact research@pdrlabs.net" 
107.22.67.189 - - [10/Aug/2014:01:01:58 +0000] "GET /clientaccesspolicy.xml HTTP/1.1" 404 1351 "-" "Cloud mapping experiment. Contact research@pdrlabs.net"

and error.log is blank

This is my first application deployed on digital ocean. I've tried googling everything but not much luck. If there are any steps that I`m missing please let me know.

1 comment
2 Answers

Please make sure you have in your application.rb

config.assets.initialize_on_precompile = false

and your production.rb should contain:

config.cache_classes = true
config.serve_static_assets = true
config.assets.compile = true
config.assets.digest = true

and you are running your app in RAILS_ENV=production

Regards

I'm also having trouble, but I haven't even figured out unicorn or nginx yet. I tried the plain ol' webrick (rails s) and most of the time the site just times out.

Have another answer? Share your knowledge.