title: "We're sorry, but something went wrong." Rails app on Ubuntu, Apache, Passenger on DigitalOcean
body: <p>This is my first time trying to deploy a Rails app on Digitalocean. I'm using Apache server and PostgreSQL for my DBM. I already have a domain which I'm trying to use for my app. Whenever I try to access my website with the domain I get:</p>
  
  <pre><code>We're sorry, but something went wrong.
  
  If you are the application owner check the logs for more information.
  </code></pre>
  
  <p>These are the logs I'm getting.</p>
  
  <p><code>/var/log/apache2/error.log</code>:</p>
  
  <pre><code>[ 2015-06-03 10:40:27.0987 27388/7f60283aa7c0 agents/HelperAgent/Main.cpp:883 ]: Starting PassengerAgent server...
  [ 2015-06-03 10:40:27.0991 27388/7f60283aa7c0 agents/HelperAgent/Main.cpp:232 ]: PassengerAgent server running in multi-application mode.
  [ 2015-06-03 10:40:27.1069 27388/7f60283aa7c0 agents/HelperAgent/Main.cpp:637 ]: PassengerAgent server online, PID 27388
  [ 2015-06-03 10:40:27.1462 27393/7f2a835cc7c0 agents/LoggingAgent/Main.cpp:431 ]: Starting PassengerAgent logger...
  [ 2015-06-03 10:40:27.1480 27393/7f2a835cc7c0 agents/LoggingAgent/Main.cpp:312 ]: PassengerAgent logger online, PID 27393
  [Wed Jun 03 10:40:27.148890 2015] [mpm_event:notice] [pid 17706:tid 140076804220800] AH00489: Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.0.2 configured -- resuming normal operations
  [Wed Jun 03 10:40:27.148934 2015] [core:notice] [pid 17706:tid 140076804220800] AH00094: Command line: '/usr/sbin/apache2'
  [ 2015-06-03 10:40:27.4303 26722/7f90f511f7c0 agents/HelperAgent/Main.cpp:868 ]: PassengerAgent server shutdown finished
  App 27471 stdout: 
  App 27489 stdout:
  </code></pre>
  
  <p><code>log/production.log</code>:</p>
  
  <pre><code>I, [2015-06-03T11:16:29.516619 #27489]  INFO -- : Started GET "/" for 186.155.86.153 at 2015-06-03 11:16:29 -0400
  F, [2015-06-03T11:16:29.543227 #27489] FATAL -- :
  PG::ConnectionBad (FATAL:  Peer authentication failed for user "Metalmind_2"):
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
    /usr/local/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
    /usr/local/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:567:in `retrieve_connection'
    activerecord (4.2.1.rc4) lib/active_record/connection_handling.rb:113:in `retrieve_connection'
    activerecord (4.2.1.rc4) lib/active_record/connection_handling.rb:87:in `connection'
    activerecord (4.2.1.rc4) lib/active_record/query_cache.rb:51:in `restore_query_cache_settings'
    activerecord (4.2.1.rc4) lib/active_record/query_cache.rb:43:in `rescue in call'
    activerecord (4.2.1.rc4) lib/active_record/query_cache.rb:31:in `call'
    activerecord (4.2.1.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
    activesupport (4.2.1.rc4) lib/active_support/callbacks.rb:88:in `call'
    activesupport (4.2.1.rc4) lib/active_support/callbacks.rb:88:in `_run_callbacks'
    activesupport (4.2.1.rc4) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
    activesupport (4.2.1.rc4) lib/active_support/callbacks.rb:81:in `run_callbacks'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    railties (4.2.1.rc4) lib/rails/rack/logger.rb:38:in `call_app'
    railties (4.2.1.rc4) lib/rails/rack/logger.rb:20:in `block in call'
    activesupport (4.2.1.rc4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
    activesupport (4.2.1.rc4) lib/active_support/tagged_logging.rb:26:in `tagged'
    activesupport (4.2.1.rc4) lib/active_support/tagged_logging.rb:68:in `tagged'
    railties (4.2.1.rc4) lib/rails/rack/logger.rb:20:in `call'
    actionpack (4.2.1.rc4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
    rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
    rack (1.6.0) lib/rack/runtime.rb:18:in `call'
    activesupport (4.2.1.rc4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
    rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
    railties (4.2.1.rc4) lib/rails/engine.rb:518:in `call'
    railties (4.2.1.rc4) lib/rails/application.rb:164:in `call'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:85:in `process_request'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:414:in `block (3 levels) in start_threads'
    /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'
  </code></pre>
  
  <p>I've been trying a lot of things already but can't find what the problem is. I appreciate if someone can give me a hand!</p>