Heroku上的Rails应用程序部署成功,但不运行查询 [英] Rails app on Heroku deployed successfully but does not run query

查看:99
本文介绍了Heroku上的Rails应用程序部署成功,但不运行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小型的rails应用程序,它可以接收用户的开始和结束地址,并根据它返回他们可以采用的总线列表。我对Rails很陌生,我已经部署应用到heroku第一次。在heroku上部署应用后,我能够成功迁移表,并运行种子来填充数据。然后像往常一样,我输入了一个开始和结束地址。点击提交后,我收到一条消息,告诉我检查我的日志。所以我运行heroku日志,这就是我得到的。

  2015-04-30T14:17:48.446444 + 00:00 heroku [web.1]:unidling 
2015-04-30T14:17:48.446877 + 00:00 heroku [web.1]:状态由下变为开始
2015-04-30T14:17:52.168701 +00:00 heroku [web.1]:使用命令`bin / rails server -p 12499 -e production`启动进程
2015-04-30T14:17:57.481206 + 00:00 app [web.1] :[2015-04-30 14:17:57] INFO ruby​​ 2.0.0(2015-04-13)[x86_64-linux]
2015-04-30T14:17:57.481180 + 00:00 app [web .1]:[2015-04-30 14:17:57] INFO WEBrick 1.3.1
2015-04-30T14:17:57.481653 + 00:00 app [web.1]:[2015-04- 30 14:17:57] INFO WEBrick :: HTTPServer#start:pid = 3 port = 12499
2015-04-30T14:17:57.638080 + 00:00 heroku [web.1]:状态从开始变为up
2015-04-30T14:17:58.565914 + 00:00 app [web.1]:=>为更多启动选项运行`rails server -h`
2015-04-30T14:17:58.565916 + 00:00 app [web.1]:=> Ctrl-C关闭服务器
2015-04-30T14:17:58.565917 + 00:00 app [web.1]:开始GET/为149.125.112.151于2015-04-30 14:17:58 +0000
2015-04-30T14:17:58.565906 + 00:00 app [web.1]:=>引导WEBrick
2015-04-30T14:17:58.565912 + 00:00 app [web.1]:=> Rails 4.2.0应用程序在http://0.0.0.0:12499开始生产
2015-04-30T14:17:59.867086 + 00:00 app [web.1]:通过WelcomeController处理#index为HTML
2015-04-30T14:17:59.891868 + 00:00 app [web.1]:布局/应用程序中的welcome / index.html.erb(2.2ms)
2015-04-30T14:17 :59.868011 + 00:00 app [web.1]:Geokit使用域名:herokuapp.com
2015-04-30T14:17:59.893573 + 00:00 app [web.1]:完成200 OK 26ms(观看次数:14.6ms | ActiveRecord:0.0ms)
2015-04-30T14:17:59.901196 + 00:00 heroku [router]:at = info method = GET path =/host = polar-oasis -8863.herokuapp.com request_id = f3885684-e8cc-4893-939d-8dd304ba81b2 fwd =149.125.112.151dyno = web.1 connect = 2ms service = 1399ms status = 200 bytes = 5771
2015-04-30T14 :18:00.810210 + 00:00 heroku [router]:at = info method = GET path =/ assets / application -b598aa7e82e5647cd54ae6f409306995766dd0ce1af586bab9ebe84804d0eec0.jshost = polar-oasis-8863.herokuapp.com request_id = c938b44d-1080-477d- 84a3-8d57f6669641 fwd =149。 125.112.151dyno = web.1 connect = 2ms service = 4ms status = 304 bytes = 133
2015-04-30T14:18:00.777510 + 00:00 heroku [router]:at = info method = GET path =/ assets / application-f555cdb8fe7a4aae0af385703ab6d5cadb675ef7c341889cc462321abdfcda80.csshost = polar-oasis-8863.herokuapp.com request_id = 682e9193-193f-4a3f-8a2f-621a365e711d fwd =149.125.112.151dyno = web.1 connect = 3ms service = 7ms status = 304 bytes = 133
2015-04-30T14:18:01.019483 + 00:00 heroku [router]:at = info method = GET path =/ css / bootstrap.min.csshost = polar -oasis-8863.herokuapp.com request_id = 5d5b09c4-acb1-488e-8705-382ee61909aa fwd =149.125.112.151dyno = web.1 connect = 1ms service = 209ms status = 200 bytes = 125647
2015-04 -30T14:18:15.570748 + 00:00 app [web.1]:Google地理编码。结果:%7B%0A +++%22%结果%22+%3A +%5B%0A ++++++%7B%0A ++++++++%22address_components%22+%3A +%5B%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%2212%22%2C% 0A +++++++++++++++%22short_name%22 +%3A +%2212%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22street_number%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +% 3A +%22Goethe +街%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22Goethe + ST%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22route%22 +%5D%0A ++++++++++++%7D%2C %0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%22Binghamton%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22Binghamton%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22locality%22% 2C +%22political%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%22Broome +县%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22Broome +县%22 %2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22administrative_area_level_2%22%2C +%22political%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++ %7B%0A +++++++++++++++%22long_name%22 +%3A +%22New +纽约%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22NY%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22administrative_area_level_1%22% 2C +%22political%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%22United +美国%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22US%22%2C %0A +++++++++++++++%22types%22 +%3A +%5B +%22country%22%2C +%22political%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%2213905%22%2C% 0A +++++++++++++++%22short_name%22 +%3A +%2213905%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22postal_code%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +% 3A +%223506%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%223506%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22postal_code_suffix%22 +%5D%0A ++++++++++++%7D%0A +++++++++%5D%2C %0A +++++++++%22formatted_address%22 +%3A +%2212 + +歌德街%2C +宾厄姆顿%2C + NY + 13905%2C +美国%22%2C%0A +++++++++%22geometry%22 +%3A +%7B%0A ++++++++++++%22location%22 +%3A +%7B%0A +++++++++++++++%22lat%22 +%3A + 42.103973%2C%0A +++++++++++++++%22lng%22 +%3A + -75.93345699999999%0A ++++++++++++%7D%2C%0A ++++++++++++%22location_type%22 +%3A +%22ROOFTOP%22%2C%0A ++++++++++++%22viewport%22 +%3A +%7B%0A +++++++++++++++%22northeast%22 +%3A +%7B%0A ++++++++++++++++++%22lat%22 +%3A + 42.1053219802915%2C%0A ++++++++++++++++++%22lng%22 +%3A + -75.93210801970848%0A +++++++++++++++%7D%2C%0A +++++++++++++++%22southwest%22 +%3A +%7B%0A ++++++++++++++++++%22lat%22 +%3A + 42.1026240197085%2C%0A ++++++++++++++++++%22lng%22 +%3A + -75.9348059802915%0A +++++++++++++++%7D %0A ++++++++++++%7D%0A +++++++++%7D%2C%0A +++++++++%22place_id%22 +%3A +%22ChIJkzQDmQ_v2okRY-0uinzqENo%22%2C%0A +++++++++%22types%22 +%3A +%5B +%22street_address%22 +%5D%0A ++++++%7D% 0A +++%5D%2C%0A +++%22status%22 +%3A +%22OK%22%0A%7D%0A
2015-04-30T14:18:15.609517 + 00:00 app [web.1]:Google地理编码。结果:%7B%0A +++%22结果%22+%3A +%5B%0A ++++++%7B%0A +++++++++%22address_components%22+%3A +%5B%0A ++++++++++++%7B%0A ++++++++++++++%22long_name%22+%3A +%22Binghamton + University%22% 2C%0A +++++++++++++++%22short_name%22 +%3A +%22Binghamton +大学%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22establishment%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name %22 +%3A +%224400%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%224400%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22street_number%22 +%5D%0A ++++++++++++%7D%2C %0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%22Vestal +大道+东%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22Vestal + PKWY + E%22%2C%0A +++++++++++++++%22types%22 +% 3A +%5B +%22route%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%22Binghamton%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22Binghamton%22%2C %0A +++++++++++++++%22types%22 +%3A +%5B +%22locality%22%2C +%22political%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B %0A +++++++++++++++%22long_name%22 +%3A +%22Vestal%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22Vestal%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22administrative_area_level_3%22%2C +%22political% 22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%22Broome +县%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22Broome +县%22%2C%0A +++++++++++++++ %22types%22 +%3A +%5B +%22administrative_area_level_2%22%2C +%22political%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%22New +纽约%22%2C% 0A +++++++++++++++%22short_name%22 +%3A +%22NY%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22administrative_area_level_1%22%2C +%22political%22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++ %22long_name%22 +%3A +%22United +美国%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%22US%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22country%22%2C +%22political% 22 +%5D%0A ++++++++++++%7D%2C%0A ++++++++++++%7B%0A +++++++++++++++%22long_name%22 +%3A +%221390 2%22%2C%0A +++++++++++++++%22short_name%22 +%3A +%2213902%22%2C%0A +++++++++++++++%22types%22 +%3A +%5B +%22postal_code%22 +%5D%0A ++++++++++++%7D%0A +++++++++%5D%2C%0A +++++++++ %22formatted_address%22 +%3A +%22Binghamton +大学%2C + 4400 +维斯塔+大道+东%2C +宾厄姆顿%2C + NY + 13902%2C +美国%22%2C%0A +++++++++%22geometry%22 +%3A +%7B %0A ++++++++++++%22bounds%22 +%3A +%7B%0A +++++++++++++++%22northeast%22 +%3A +%7B%0A ++++++++++++++++++%22lat%22 +%3A + 42.0956999%2C%0A ++++++++++++++++++%22lng%22 +%3A + -75.95752920000001%0A +++++++++++++++%7D %2C%0A +++++++++++++++%22southwest%22 +%3A +%7B%0A ++++++++++++++++++%22lat%22 +%3A + 42.0814946%2C%0A ++++++++++++++++++%22lng%22 +%3A + -75.98218439999999%0A +++++++++++++++%7D%0A ++++++++++++%7D%2C%0A ++++++++++++% 22location%22 +%3A +%7B%0A +++++++++++++++%22lat%22 +%3A + 42.088828%2C%0A +++++++++++++++%22lng%22 +%3A + -75.96697209999999%0A ++++++++++++%7D%2C%0A ++++++++++++%22location_type%22 +%3A +%22APPROXIMATE% 22%2C%0A ++++++++++++%22viewport%22 +%3A +%7B%0A +++++++++++++++%22northeast%22 +%3A +%7B%0A +++ +++++++++++++++%22lat%22 +%3A + 42.0956999%2C%0A ++++++++++++++++++%22lng%22 +%3A + -75.95752920000001%0A +++++++++++++++%7D%2C%0A +++++++++++++++%22southwest%22 + %3A +%7B%0A ++++++++++++++++++%22lat%22 +%3A + 42.0814946%2C%0A ++++++++++++++++++%22lng%22 +%3A + -75.98218439999999%0A +++++++++++++++%7D%0A ++++++++++++%7D%0A +++++++++%7D%2C%0A +++++++++%22place_id%22 +% 3A +%22ChIJaTEedLju2okR3z5p7vGc53M%22%2C%0A +++++++++%22types%22 +%3A +%5B +%22university%22%2C +%22establishment%22 +%5D%0A ++++++%7D%0A +++%5D%2C%0A +++%22status%22 +%3A + %22OK%22%0A%7D%0A
2015-04-30T14:18:15.574832 + 00:00 app [web.1]:Google地理编码。地址:Binghamton University,Vestal Parkway East,Binghamton,NY,美国,args []
2015-04-30T14:18:15.435864 + 00:00 app [web.1]:通过WelcomeController处理#以HTML格式创建
2015-04-30T14:18:15.435917 + 00:00 app [web.1]:参数:{utf8=>✓,authenticity_token=>Z8XgjHvHP81VKxCNaByRSmQJ5x + 103 + WoujaZv / u4LFRdHN3E9n1eAZYnrIDsfMhwQ + ios9MzX / ikmvF8qCOgQ ==,address=>12 Goethe St,Binghamton,NY,United States,destaddress=>Binghamton University,Vestal Parkway East,Binghamton,NY,United States, commit=>查找巴士}
2015-04-30T14:18:15.432864 + 00:00 app [web.1]:开始POST/ welcome / indexfor 149.125.112.151 at 2015- 04-30 14:18:15 +0000
2015-04-30T14:18:15.436927 + 00:00应用[web.1]:多地理编码。地址:12 Goethe St,Binghamton,NY,美国,args []
2015-04-30T14:18:15.436688 + 00:00 app [web.1]:Geokit使用域名:herokuapp.com
2015-04-30T14:18:15.574774 + 00:00应用[web.1]:多地理编码。地址:Binghamton University,Vestal Parkway East,Binghamton,NY,美国,args []
2015-04-30T14:18:15.437011 + 00:00 app [web.1]:Google地理编码。地址:12 Goethe St,Binghamton,NY,美国,args []
2015-04-30T14:18:16.206604 + 00:00 app [web.1]:SIN(0.7348529570207945)* SIN(RADIANS .latitude))))* 3963.1899999999996)
2015-04-30T14:18:16.206606 + 00:00 app [web.1]:ASC LIMIT 1
2015-04-30T14:18:16.206591+ 00:00 app [web.1]:停止加载(592.5ms)SELECTstops。* FROMstopsORDER BY
2015-04-30T14:18:16.206599 + 00:00 app [web.1 ]:(ACOS(least(1,COS(0.7348529570207945)* COS(-1.3252888370715357)* COS(RADIANS(stops.latitude))* COS(RADIANS(stops.longitude))+
2015-04-30T14: 18:16.206603 + 00:00 app [web.1]:COS(0.7348529570207945)* SIN(-1.3252888370715357)* COS(RADIANS(stops.latitude))* SIN(RADIANS(stops.longitude))+
2015 -04-30T14:18:16.968727 + 00:00 app [web.1]:停止加载(9.6ms)选择停止* FROMstopsORDER BY
2015-04-30T14:18:16.968739 +00:00 app [web.1]:COS(0.7345886269055799)* SIN(-1.3258737859156708)* COS(RADIANS(stops.latitude))* SIN(RADIANS(s (ACOS(最少(1,COS(0.7345886269055799)* COS(-1.3258737859156708)* COS(最小值为1))+
2015-04-30T14:18:16.968737 + 00:00 app [web.1] RADIANS(stops.latitude))* COS(RADIANS(stops.longitude))+
2015-04-30T14:18:16.968741 + 00:00 app [web.1]:SIN(0.7345886269055799)* SIN(RADIANS (stops.latitude))))* 3963.1899999999996)
2015-04-30T14:18:16.968743 + 00:00 app [web.1]:ASC LIMIT 1
2015-04-30T14:18: 16.981001 + 00:00 app [web.1]:停止加载(3.3ms)SELECTstops。* FROMstopsWHEREstops。id= $ 1 LIMIT 1 [[id,14]]
2015-04-30T14:18:17.029400 + 00:00 app [web.1]:在1593ms内完成500个内部伺服器错误
2015-04-30T14:18:16.983127 + 00:00 app [web .1]:停止加载(1.4ms)SELECT停止。* FROMstopsWHEREstops。id= $ 1 LIMIT 1 [[id,1]]
2015-04-30T14 :18:17.083340 + 00:00 app [web.1]:
2015-04-30T14:18:17.094117 + 00:00 heroku [router]:at = info method = POST path =/ welcome / index host = polar-oasis-8863.herokuapp.com request_id = e8ce331 f-e205-48b9-a49a-fd1c83ea11c8 fwd =149.125.112.151dyno = web.1 connect = 2ms service = 1673ms status = 500 bytes = 1754
2015-04-30T14:18:17.083360 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / abstract / connection_pool.rb:436:in`new_connection'
2015-04 -30T14:18:17.083352 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / postgresql_adapter.rb:651:in`new '
2015-04-30T14:18:17.083354 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / postgresql_adapter .rb:651:在`connect'
2015-04-30T14:18:17.083357 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 /lib/active_record/connection_adapters/postgresql_adapter.rb:44:in`new'
2015-04-30T14:18:17.083359 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 /gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44: in`postgresql_connection'
2015-04-30T14:18:17.083362 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / $ _ $ b 2015-04-30T14:18:17.083364 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / abstract / connection_pool.rb:422:在'acquire_connection'
2015-04-30T14:18:17.083346 + 00:00 app [web.1]:PG: :ConnectionBad(fe_sendauth:无密码提供
2015-04-30T14:18:17.083348 + 00:00 app [web.1]:):
2015-04-30T14:18:17.083350 + 00: 00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / postgresql_adapter.rb:651:in`initialize'
2015-04- 30T14:18:17.083373 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / abstract / connection_pool.rb:348:结帐'
2015-04-30T14:18:17.083374 + 00:00 app [web。 1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / abstract / connection_pool.rb:263:在`block in connection'
2015-04-30T14 :18:17.083376 + 00:00 app [web.1]:vendor / ruby​​-2.0.0 / lib / ruby​​ / 2.0.0 / monitor.rb:211:在`mon_synchronize'
2015-04-30T14 :18:17.083370 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / abstract / connection_pool.rb:349:在结帐'
2015-04-30T14:18:17.083378 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters /abstract/connection_pool.rb:262:in`connection'
2015-04-30T14:18:17.083371 + 00:00 app [web.1]:vendor / ruby​​-2.0.0 / lib / ruby​​ / 2.0 .0 / monitor.rb:211:在`mon_synchronize'
2015-04-30T14:18:17.083383 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord -4.2.0 / lib / active_record / connection_handling.rb:87:在`connection'
2015-04-30T14:18:17.083386 + 00:00 app [web.1]:ve ndor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / query_cache.rb:43:在'rescue in call'中
2015-04-30T14:18:17.083388 + 00: 00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / query_cache.rb:31:`call'
2015-04-30T14: 18:17.083389 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / abstract / connection_pool.rb:647:
2015-04-30T14:18:17.083391 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / callbacks。 rb:29:在`block in call'中
2015-04-30T14:18:17.083393 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.2。 0 / lib / active_support / callbacks.rb:88:在`call'
2015-04-30T14:18:17.083394 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.2.0 / lib / active_support / callbacks.rb:88:在`_run_callbacks'
2015-04-30T14:18:17.083356 + 00:00 app [web.1]:vendor / bundle /红宝石/ 2.0.0 /宝石/活性record-4.2.0 / lib / active_record / connection_adapters / postgresql_adapter.rb:242:在`initialize'
2015-04-30T14:18:17.083397 + 00:00 app [web.1]:vendor / bundle / ruby / 2.0.0 / gems / activesupport-4.2.0 / lib / active_support / callbacks.rb:81:在`run_callbacks'
2015-04-30T14:18:17.083398 + 00:00 app [web.1 ]:vendor / bundle / ruby​​ / 2.0.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / callbacks.rb:27:`call'
2015-04-30T14:18:17.083400+ 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / remote_ip.rb:78:`call'
2015- 04-30T14:18:17.083401 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / debug_exceptions.rb:17:请拨打'
2015-04-30T14:18:17.083396 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.2.0 / lib / active_support / callbacks。 rb:734:在`_run_call_callbacks'
2015-04-30T14:18:17.083380 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / connection_adapters / abstract / connection_pool.rb:565:'retrieve_connection'
2015-04-30T14:18:17.083381 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0。 0 / gems / activerecord-4.2.0 / lib / active_record / connection_handling.rb:113:在'retrieve_connection'
2015-04-30T14:18:17.083385 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.2.0 / lib / active_record / query_cache.rb:51:在`restore_query_cache_settings'
2015-04-30T14:18:17.083403 + 00:00 app [web .1]:vendor / bundle / ruby​​ / 2.0.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / show_exceptions.rb:30:`call'
2015-04-30T14:18: 17.083405 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / railties-4.2.0 / lib / rails / rack / logger.rb:38:`call_app'
2015-04-30T14:18:17.083406 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / railties-4.2.0 / lib / rails / rack / logger.rb:20: in`block in call'
2015-04-30T14:18:17.083408 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.2.0 / lib /
2015-04-30T14:18:17.085201 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.2.0 / lib / active_support / tagged_logging.rb:26:在`tagged'
2015-04-30T14:18:17.085205 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / railties-4.2.0 / lib / rails / rack / logger.rb:20:在`call'中
2015-04-30T14:18:17.085207 + 00:00 app [web.1 ]:vendor / bundle / ruby​​ / 2.0.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / request_id.rb:21:`call'
2015-04-30T14:18:17.085208+ 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / rack-1.6.0 / lib / rack / methodoverride.rb:22:`call'
2015-04- 30T14:18:17.085210 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / rack-1.6.0 / lib / rack / runtime.rb:18:`call'
2015-04-30T14:18:17.085204 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.2.0 / lib / active_support / tagged_logging.rb:68: in`tagged'
2015-04-30T14:18:17.085236 + 00:00 app [web.1]:vendor / bundle / ruby /2.0.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in`service'
2015-04-30T14:18:17.085238 + 00:00 app [web。 1]:vendor / ruby​​-2.0.0 / lib / ruby​​ / 2.0.0 / webrick / httpserver.rb:138:在'service'
2015-04-30T14:18:17.085239 + 00:00 app [ web.1]:vendor / ruby​​-2.0.0 / lib / ruby​​ / 2.0.0 / webrick / httpserver.rb:94:'run'
2015-04-30T14:18:17.085216 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / railties-4.2.0 / lib / rails / engine.rb:518:in`call'
2015-04-30T14:18 :17.085211 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.2.0 / lib / active_support / cache / strategy / local_cache_middleware.rb:28:`call'
2015-04-30T14:18:17.085213 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / static.rb :113:`call'
2015-04-30T14:18:17.085214 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / rack-1.6.0 / lib /rack/sendfile.rb:113:in`call'
2015-04-30T14:18:17.085217 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / railti es-4.2.0 / lib / rails / application.rb:164:在`call'
2015-04-30T14:18:17.085235 + 00:00 app [web.1]:vendor / bundle / ruby​​ / 2.0.0 / gems / rack-1.6.0 / lib / rack / content_length.rb:15:在`call'
2015-04-30T14:18:17.085218 + 00:00 app [web.1]: vendor / bundle / ruby​​ / 2.0.0 / gems / rack-1.6.0 / lib / rack / lock.rb:17:在`call'
2015-04-30T14:18:17.085241 + 00:00 app [web.1]:vendor / ruby​​-2.0.0 / lib / ruby​​ / 2.0.0 / webrick / server.rb:295:在`block in start_thread'
2015-04-30T14:18:17.085242+ 00:00 app [web.1]:
2015-04-30T14:18:17.085244 + 00:00 app [web.1]:


以下是我的database.yml文件

 #MySQL。建议使用5.0+版本。 

#安装MYSQL驱动程序
#gem install mysql2

#确保MySQL Gem在您的Gemfile中定义
#gem'mysql2'

#并确保使用新式密码哈希:
#http://dev.mysql.com/doc/refman/5.0/en/old-client.html

默认值:& default
适配器:postgresql
编码:utf8
池:5
用户名:root
密码:
#socket:/tmp/mysql.sock

开发:
<:lt::* default
数据库:BingBus_development

#警告:The定义为测试的数据库将被删除,并且当您运行rake时,您的开发数据库将重新生成
#。
#不要将此db设置为与开发或生产相同。
test:
<:lt:* default
database:BingBus_test

#与config / secrets.yml一样,你永远不想存储敏感信息,
#就像你的数据库密码一样,在你的源代码中。如果你的源代码是任何人都见过的
#,他们现在可以访问你的数据库。

#相反,当您启动
#应用程序时,将密码作为unix环境变量提供。阅读http://guides.rubyonrails.org/configuring.html#configuring-a-database
#以全面了解如何在
#生产部署中提供这些环境变量。

#在Heroku和其他平台提供程序上,您可能有一个完整的连接URL
#作为环境变量可用。例如:

#DATABASE_URL =ec2-23-21-140-156.compute-1.amazonaws.com

#您可以使用此数据库配置with:

#production:
#url:<%= ENV ['DATABASE_URL']%>

制作:
<:lt::* default
数据库:BingBus_production
用户名:BingBus
密码:<%= ENV ['BINGBUS_DATABASE_PASSWORD ']%>

日志似乎也在运行我的查询,但由于某种原因,有一个错误。我不知道为什么。我很亲密,我知道但我错过了一些东西。如果有人可以帮我解决问题,我将非常感激。

解决方案

假设您正在使用 Heroku Postgres 删除此部分:

 制作:
<<<:* default
数据库:BingBus_production
用户名:BingBus
密码:<%= ENV ['BINGBUS_DATABASE_PASSWORD']%>

Heroku设置数据库并自动配置您的Rails应用程序。


I have a small rails application that takes users start and end address and returns a list of buses they can take based on that. I am very new to rails and i have deployed app to heroku first time. After deploying app on heroku i was able to successfully migrate tables, and also run seed to populate data. Then as usual i entered a start and end address. After hitting submit i get message telling me to check my logs. So I run heroku logs and this is what i get.

2015-04-30T14:17:48.446444+00:00 heroku[web.1]: Unidling
2015-04-30T14:17:48.446877+00:00 heroku[web.1]: State changed from down to starting
2015-04-30T14:17:52.168701+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 12499 -e production`
2015-04-30T14:17:57.481206+00:00 app[web.1]: [2015-04-30 14:17:57] INFO  ruby 2.0.0 (2015-04-13) [x86_64-linux]
2015-04-30T14:17:57.481180+00:00 app[web.1]: [2015-04-30 14:17:57] INFO  WEBrick 1.3.1
2015-04-30T14:17:57.481653+00:00 app[web.1]: [2015-04-30 14:17:57] INFO  WEBrick::HTTPServer#start: pid=3 port=12499
2015-04-30T14:17:57.638080+00:00 heroku[web.1]: State changed from starting to up
2015-04-30T14:17:58.565914+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-04-30T14:17:58.565916+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-04-30T14:17:58.565917+00:00 app[web.1]: Started GET "/" for 149.125.112.151 at 2015-04-30 14:17:58 +0000
2015-04-30T14:17:58.565906+00:00 app[web.1]: => Booting WEBrick
2015-04-30T14:17:58.565912+00:00 app[web.1]: => Rails 4.2.0 application starting in production on http://0.0.0.0:12499
2015-04-30T14:17:59.867086+00:00 app[web.1]: Processing by WelcomeController#index as HTML
2015-04-30T14:17:59.891868+00:00 app[web.1]:   Rendered welcome/index.html.erb within layouts/application (2.2ms)
2015-04-30T14:17:59.868011+00:00 app[web.1]: Geokit is using the domain: herokuapp.com
2015-04-30T14:17:59.893573+00:00 app[web.1]: Completed 200 OK in 26ms (Views: 14.6ms | ActiveRecord: 0.0ms)
2015-04-30T14:17:59.901196+00:00 heroku[router]: at=info method=GET path="/" host=polar-oasis-8863.herokuapp.com request_id=f3885684-e8cc-4893-939d-8dd304ba81b2 fwd="149.125.112.151" dyno=web.1 connect=2ms service=1399ms status=200 bytes=5771
2015-04-30T14:18:00.810210+00:00 heroku[router]: at=info method=GET path="/assets/application-b598aa7e82e5647cd54ae6f409306995766dd0ce1af586bab9ebe84804d0eec0.js" host=polar-oasis-8863.herokuapp.com request_id=c938b44d-1080-477d-84a3-8d57f6669641 fwd="149.125.112.151" dyno=web.1 connect=2ms service=4ms status=304 bytes=133
2015-04-30T14:18:00.777510+00:00 heroku[router]: at=info method=GET path="/assets/application-f555cdb8fe7a4aae0af385703ab6d5cadb675ef7c341889cc462321abdfcda80.css" host=polar-oasis-8863.herokuapp.com request_id=682e9193-193f-4a3f-8a2f-621a365e711d fwd="149.125.112.151" dyno=web.1 connect=3ms service=7ms status=304 bytes=133
2015-04-30T14:18:01.019483+00:00 heroku[router]: at=info method=GET path="/css/bootstrap.min.css" host=polar-oasis-8863.herokuapp.com request_id=5d5b09c4-acb1-488e-8705-382ee61909aa fwd="149.125.112.151" dyno=web.1 connect=1ms service=209ms status=200 bytes=125647
2015-04-30T14:18:15.570748+00:00 app[web.1]: Google geocoding. Result: %7B%0A+++%22results%22+%3A+%5B%0A++++++%7B%0A+++++++++%22address_components%22+%3A+%5B%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%2212%22%2C%0A+++++++++++++++%22short_name%22+%3A+%2212%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22street_number%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Goethe+Street%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Goethe+St%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22route%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Binghamton%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Binghamton%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22locality%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Broome+County%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Broome+County%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22administrative_area_level_2%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22New+York%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22NY%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22administrative_area_level_1%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22United+States%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22US%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22country%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%2213905%22%2C%0A+++++++++++++++%22short_name%22+%3A+%2213905%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22postal_code%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%223506%22%2C%0A+++++++++++++++%22short_name%22+%3A+%223506%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22postal_code_suffix%22+%5D%0A++++++++++++%7D%0A+++++++++%5D%2C%0A+++++++++%22formatted_address%22+%3A+%2212+Goethe+Street%2C+Binghamton%2C+NY+13905%2C+USA%22%2C%0A+++++++++%22geometry%22+%3A+%7B%0A++++++++++++%22location%22+%3A+%7B%0A+++++++++++++++%22lat%22+%3A+42.103973%2C%0A+++++++++++++++%22lng%22+%3A+-75.93345699999999%0A++++++++++++%7D%2C%0A++++++++++++%22location_type%22+%3A+%22ROOFTOP%22%2C%0A++++++++++++%22viewport%22+%3A+%7B%0A+++++++++++++++%22northeast%22+%3A+%7B%0A++++++++++++++++++%22lat%22+%3A+42.1053219802915%2C%0A++++++++++++++++++%22lng%22+%3A+-75.93210801970848%0A+++++++++++++++%7D%2C%0A+++++++++++++++%22southwest%22+%3A+%7B%0A++++++++++++++++++%22lat%22+%3A+42.1026240197085%2C%0A++++++++++++++++++%22lng%22+%3A+-75.9348059802915%0A+++++++++++++++%7D%0A++++++++++++%7D%0A+++++++++%7D%2C%0A+++++++++%22place_id%22+%3A+%22ChIJkzQDmQ_v2okRY-0uinzqENo%22%2C%0A+++++++++%22types%22+%3A+%5B+%22street_address%22+%5D%0A++++++%7D%0A+++%5D%2C%0A+++%22status%22+%3A+%22OK%22%0A%7D%0A
2015-04-30T14:18:15.609517+00:00 app[web.1]: Google geocoding. Result: %7B%0A+++%22results%22+%3A+%5B%0A++++++%7B%0A+++++++++%22address_components%22+%3A+%5B%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Binghamton+University%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Binghamton+University%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22establishment%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%224400%22%2C%0A+++++++++++++++%22short_name%22+%3A+%224400%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22street_number%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Vestal+Parkway+East%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Vestal+Pkwy+E%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22route%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Binghamton%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Binghamton%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22locality%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Vestal%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Vestal%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22administrative_area_level_3%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22Broome+County%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22Broome+County%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22administrative_area_level_2%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22New+York%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22NY%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22administrative_area_level_1%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%22United+States%22%2C%0A+++++++++++++++%22short_name%22+%3A+%22US%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22country%22%2C+%22political%22+%5D%0A++++++++++++%7D%2C%0A++++++++++++%7B%0A+++++++++++++++%22long_name%22+%3A+%2213902%22%2C%0A+++++++++++++++%22short_name%22+%3A+%2213902%22%2C%0A+++++++++++++++%22types%22+%3A+%5B+%22postal_code%22+%5D%0A++++++++++++%7D%0A+++++++++%5D%2C%0A+++++++++%22formatted_address%22+%3A+%22Binghamton+University%2C+4400+Vestal+Parkway+East%2C+Binghamton%2C+NY+13902%2C+USA%22%2C%0A+++++++++%22geometry%22+%3A+%7B%0A++++++++++++%22bounds%22+%3A+%7B%0A+++++++++++++++%22northeast%22+%3A+%7B%0A++++++++++++++++++%22lat%22+%3A+42.0956999%2C%0A++++++++++++++++++%22lng%22+%3A+-75.95752920000001%0A+++++++++++++++%7D%2C%0A+++++++++++++++%22southwest%22+%3A+%7B%0A++++++++++++++++++%22lat%22+%3A+42.0814946%2C%0A++++++++++++++++++%22lng%22+%3A+-75.98218439999999%0A+++++++++++++++%7D%0A++++++++++++%7D%2C%0A++++++++++++%22location%22+%3A+%7B%0A+++++++++++++++%22lat%22+%3A+42.088828%2C%0A+++++++++++++++%22lng%22+%3A+-75.96697209999999%0A++++++++++++%7D%2C%0A++++++++++++%22location_type%22+%3A+%22APPROXIMATE%22%2C%0A++++++++++++%22viewport%22+%3A+%7B%0A+++++++++++++++%22northeast%22+%3A+%7B%0A++++++++++++++++++%22lat%22+%3A+42.0956999%2C%0A++++++++++++++++++%22lng%22+%3A+-75.95752920000001%0A+++++++++++++++%7D%2C%0A+++++++++++++++%22southwest%22+%3A+%7B%0A++++++++++++++++++%22lat%22+%3A+42.0814946%2C%0A++++++++++++++++++%22lng%22+%3A+-75.98218439999999%0A+++++++++++++++%7D%0A++++++++++++%7D%0A+++++++++%7D%2C%0A+++++++++%22place_id%22+%3A+%22ChIJaTEedLju2okR3z5p7vGc53M%22%2C%0A+++++++++%22types%22+%3A+%5B+%22university%22%2C+%22establishment%22+%5D%0A++++++%7D%0A+++%5D%2C%0A+++%22status%22+%3A+%22OK%22%0A%7D%0A
2015-04-30T14:18:15.574832+00:00 app[web.1]: Google geocoding. address: Binghamton University, Vestal Parkway East, Binghamton, NY, United States, args []
2015-04-30T14:18:15.435864+00:00 app[web.1]: Processing by WelcomeController#create as HTML
2015-04-30T14:18:15.435917+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"Z8XgjHvHP81VKxCNaByRSmQJ5x+l03+WoujaZv/u4LFRdHN3E9n1eAZYnrIDsfMhwQ+ios9MzX/ikmvF8qCOgQ==", "address"=>"12 Goethe St, Binghamton, NY, United States", "destaddress"=>"Binghamton University, Vestal Parkway East, Binghamton, NY, United States", "commit"=>"Find Buses"}
2015-04-30T14:18:15.432864+00:00 app[web.1]: Started POST "/welcome/index" for 149.125.112.151 at 2015-04-30 14:18:15 +0000
2015-04-30T14:18:15.436927+00:00 app[web.1]: Multi geocoding. address: 12 Goethe St, Binghamton, NY, United States, args []
2015-04-30T14:18:15.436688+00:00 app[web.1]: Geokit is using the domain: herokuapp.com
2015-04-30T14:18:15.574774+00:00 app[web.1]: Multi geocoding. address: Binghamton University, Vestal Parkway East, Binghamton, NY, United States, args []
2015-04-30T14:18:15.437011+00:00 app[web.1]: Google geocoding. address: 12 Goethe St, Binghamton, NY, United States, args []
2015-04-30T14:18:16.206604+00:00 app[web.1]:           SIN(0.7348529570207945)*SIN(RADIANS(stops.latitude))))*3963.1899999999996)
2015-04-30T14:18:16.206606+00:00 app[web.1]:           ASC LIMIT 1
2015-04-30T14:18:16.206591+00:00 app[web.1]:   Stop Load (592.5ms)  SELECT  "stops".* FROM "stops"  ORDER BY 
2015-04-30T14:18:16.206599+00:00 app[web.1]:           (ACOS(least(1,COS(0.7348529570207945)*COS(-1.3252888370715357)*COS(RADIANS(stops.latitude))*COS(RADIANS(stops.longitude))+
2015-04-30T14:18:16.206603+00:00 app[web.1]:           COS(0.7348529570207945)*SIN(-1.3252888370715357)*COS(RADIANS(stops.latitude))*SIN(RADIANS(stops.longitude))+
2015-04-30T14:18:16.968727+00:00 app[web.1]:   Stop Load (9.6ms)  SELECT  "stops".* FROM "stops"  ORDER BY 
2015-04-30T14:18:16.968739+00:00 app[web.1]:           COS(0.7345886269055799)*SIN(-1.3258737859156708)*COS(RADIANS(stops.latitude))*SIN(RADIANS(stops.longitude))+
2015-04-30T14:18:16.968737+00:00 app[web.1]:           (ACOS(least(1,COS(0.7345886269055799)*COS(-1.3258737859156708)*COS(RADIANS(stops.latitude))*COS(RADIANS(stops.longitude))+
2015-04-30T14:18:16.968741+00:00 app[web.1]:           SIN(0.7345886269055799)*SIN(RADIANS(stops.latitude))))*3963.1899999999996)
2015-04-30T14:18:16.968743+00:00 app[web.1]:           ASC LIMIT 1
2015-04-30T14:18:16.981001+00:00 app[web.1]:   Stop Load (3.3ms)  SELECT  "stops".* FROM "stops" WHERE "stops"."id" = $1 LIMIT 1  [["id", 14]]
2015-04-30T14:18:17.029400+00:00 app[web.1]: Completed 500 Internal Server Error in 1593ms
2015-04-30T14:18:16.983127+00:00 app[web.1]:   Stop Load (1.4ms)  SELECT  "stops".* FROM "stops" WHERE "stops"."id" = $1 LIMIT 1  [["id", 1]]
2015-04-30T14:18:17.083340+00:00 app[web.1]: 
2015-04-30T14:18:17.094117+00:00 heroku[router]: at=info method=POST path="/welcome/index" host=polar-oasis-8863.herokuapp.com request_id=e8ce331f-e205-48b9-a49a-fd1c83ea11c8 fwd="149.125.112.151" dyno=web.1 connect=2ms service=1673ms status=500 bytes=1754
2015-04-30T14:18:17.083360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
2015-04-30T14:18:17.083352+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
2015-04-30T14:18:17.083354+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
2015-04-30T14:18:17.083357+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
2015-04-30T14:18:17.083359+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
2015-04-30T14:18:17.083362+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
2015-04-30T14:18:17.083364+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
2015-04-30T14:18:17.083346+00:00 app[web.1]: PG::ConnectionBad (fe_sendauth: no password supplied
2015-04-30T14:18:17.083348+00:00 app[web.1]: ):
2015-04-30T14:18:17.083350+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
2015-04-30T14:18:17.083373+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
2015-04-30T14:18:17.083374+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
2015-04-30T14:18:17.083376+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
2015-04-30T14:18:17.083370+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
2015-04-30T14:18:17.083378+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
2015-04-30T14:18:17.083371+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
2015-04-30T14:18:17.083383+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
2015-04-30T14:18:17.083386+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:43:in `rescue in call'
2015-04-30T14:18:17.083388+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:31:in `call'
2015-04-30T14:18:17.083389+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
2015-04-30T14:18:17.083391+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2015-04-30T14:18:17.083393+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `call'
2015-04-30T14:18:17.083394+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `_run_callbacks'
2015-04-30T14:18:17.083356+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
2015-04-30T14:18:17.083397+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
2015-04-30T14:18:17.083398+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2015-04-30T14:18:17.083400+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
2015-04-30T14:18:17.083401+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2015-04-30T14:18:17.083396+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
2015-04-30T14:18:17.083380+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
2015-04-30T14:18:17.083381+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
2015-04-30T14:18:17.083385+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:51:in `restore_query_cache_settings'
2015-04-30T14:18:17.083403+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2015-04-30T14:18:17.083405+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
2015-04-30T14:18:17.083406+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
2015-04-30T14:18:17.083408+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2015-04-30T14:18:17.085201+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
2015-04-30T14:18:17.085205+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
2015-04-30T14:18:17.085207+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2015-04-30T14:18:17.085208+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.6.0/lib/rack/methodoverride.rb:22:in `call'
2015-04-30T14:18:17.085210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.6.0/lib/rack/runtime.rb:18:in `call'
2015-04-30T14:18:17.085204+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
2015-04-30T14:18:17.085236+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in `service'
2015-04-30T14:18:17.085238+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2015-04-30T14:18:17.085239+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2015-04-30T14:18:17.085216+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
2015-04-30T14:18:17.085211+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
2015-04-30T14:18:17.085213+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:113:in `call'
2015-04-30T14:18:17.085214+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
2015-04-30T14:18:17.085217+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
2015-04-30T14:18:17.085235+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.6.0/lib/rack/content_length.rb:15:in `call'
2015-04-30T14:18:17.085218+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.6.0/lib/rack/lock.rb:17:in `call'
2015-04-30T14:18:17.085241+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2015-04-30T14:18:17.085242+00:00 app[web.1]: 
2015-04-30T14:18:17.085244+00:00 app[web.1]: 

I am not sure what this error is about at all.

Following is my database.yml File

# MySQL.  Versions 5.0+ are recommended.
#
# Install the MYSQL driver
#   gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
#   gem 'mysql2'
#
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
#
default: &default
  adapter: postgresql
  encoding: utf8
  pool: 5
  username: root
  password:
# socket: /tmp/mysql.sock

development:
  <<: *default
  database: BingBus_development

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: BingBus_test

# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
#   DATABASE_URL="ec2-23-21-140-156.compute-1.amazonaws.com"
#
# You can use this database configuration with:
#
#    production:
#      url: <%= ENV['DATABASE_URL'] %>
#
production:
  <<: *default
  database: BingBus_production
  username: BingBus
  password: <%= ENV['BINGBUS_DATABASE_PASSWORD'] %>

The log seems to be running my query too but for some reason there is an error. I HAVE no idea why. I am so close i know but i am missing something. I WOULD be very grateful if someone can help me here.

解决方案

Assuming you're using Heroku Postgres, remove this part:

production:
  <<: *default
  database: BingBus_production
  username: BingBus
  password: <%= ENV['BINGBUS_DATABASE_PASSWORD'] %>

Heroku sets up the database and configures your rails app automatically.

这篇关于Heroku上的Rails应用程序部署成功,但不运行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆