“我们很抱歉,但有些不对劲。”数字海洋上的Ubuntu,Apache,Passenger上的Rails应用程序

时间:2015-06-03 15:25:32

标签: ruby-on-rails ruby apache ubuntu

这是我第一次尝试在Digitalocean上部署Rails应用程序。我正在为我的DBM使用Apache服务器和PostgreSQL。我已经有一个域名,我正在尝试用于我的应用程序。每当我尝试使用我获得的域名访问我的网站时:

We're sorry, but something went wrong.

If you are the application owner check the logs for more information.

这些是我得到的日志。

/var/log/apache2/error.log

[ 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:

log/production.log

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'

我已经尝试了很多东西,但找不到问题所在。如果有人能帮助我,我感激不尽!

1 个答案:

答案 0 :(得分:1)

我可以看到你有PG错误,你可以做出这些改变:

var map;
function initialize() {
        var mapOptions = {
          zoom: 12,
          center: new google.maps.LatLng(-7.045000, 110.426000),
          mapTypeId: google.maps.MapTypeId.ROADMAP 
        }
        map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
setMarkers(map, markers);
};

var markers = [['MSC SEMARANG', -7.045000, 110.426000, 1107, '../images/tower2.png'], ['Srondol', -7.062000, 110.418000, 1108, '../images/tower2.png']];
var infowindow = new google.maps.InfoWindow();

function setMarkers(map, locations) {
        var marker, i;
        for (i = 0; i < locations.length; i++) {  
          var markers = locations[i];
          var myLatLng = new google.maps.LatLng(locations[i][1], locations[i][2]);
          var marker = new google.maps.Marker({
            position: myLatLng,
            map: map,
            title: locations[i][0],
            zIndex: locations[i][3],
            icon: locations[i][4]
          });
          google.maps.event.addListener(marker, 'click', (function(marker, i) {
            return function() {
              infowindow.setContent(locations[i][0]);
              infowindow.open(map, marker);
              changeTitle(this);
            }
          })(marker, i));
        }
      };

      function changeTitle(x) {
        var count = 0;
          var titles = x.get('title');
          x.set('title', 'this is chaged');
      };

google.maps.event.addDomListener(window, 'load', initialize);