获取 Rails 错误 500:指向乘客和 gmap 的日志

发布于 2024-09-13 07:28:05 字数 3029 浏览 8 评论 0原文

我目前正在生产中运行一个 Rails 应用程序。每当我尝试访问我的主页时,都会收到错误 500。这种情况最近才开始发生,所以我之前已经成功运行过该应用程序。

我意识到我可以访问我的一些内部页面,并且这个问题似乎在使用谷歌地图 API 的页面上很常见。所以我想这可能是两件事之一:由于我位于共享服务器主机上,我可能做了一些损害我权利的事情,现在 gmap 无法拨打电话。或者,这可能与我的 API 密钥有关,我认为我已经测试过它并确认它正在工作。

谢谢,我很感激任何帮助。

IK

这是我的日志: 处理 HomeController#home(对于 XX.XXX.XXX.XXX,于 2010-08-06 12:12:07)[GET] 布局/应用程序中的渲染模板 在 app /views/home/

_home_left_content_area.html.erb 的第 51 行渲染 app/views/home/home.html.erb ActionView::TemplateError (nil:NilClass 的未定义方法“text”): 48:@short_article_list.each文章| 49:地址=字符串.new 50: 地址 = 文章.相关位置.位置名称 + " " + 文章.相关位置.父位置名称 + " " + 文章.相关位置.父位置.父位置名称 51: 结果 = 地理编码::get(地址) 52: 如果 result.status == 地理编码::GEO_SUCCESS 53: lat_long = 结果.first.latlon 54: lat_val = lat_long[0]

app/views/home/_home_left_content_area.html.erb:51
app/views/home/_home_left_content_area.html.erb:48:in `each'
app/views/home/_home_left_content_area.html.erb:48
app/views/home/home.html.erb:13
app/controllers/home_controller.rb:362:in `home'
passenger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.15) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application'
passenger (2.2.15) lib/phusion_passenger/utils.rb:252:in `safe_fork'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:in `spawn_rails_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

渲染 /home/neembusc/neembus/public/500.html (500 内部服务器错误)

I am currently running a rails app in production. Whenever i try to access my home page i get an error 500. This started happening recently so i have successfully run the app before.

I realised that i could access some of my inner pages and this problem seems to be common on pages using google maps api. So i figured it could be one of two things: since I am on a shared server host, i might have done something that compromised my rights and now gmaps cant make calls. Alternatively, it could be something to do with my API key, thought i have tested it and confirmed that it is working.

Thank you, I appreciate any help.

IK

This is my log:
Processing HomeController#home (for XX.XXX.XXX.XXX at 2010-08-06 12:12:07) [GET]
Rendering template within layouts/application
Rendering app/views/home/home.html.erb

ActionView::TemplateError (undefined method `text' for nil:NilClass) on line #51 of app/views/home/_home_left_content_area.html.erb:
48: @short_article_list.each { | article |
49: address = String.new
50: address = article.related_location.location_name + " " + article.related_location.parent.location_name + " " + article.related_location.parent.parent.location_name
51: result = Geocoding::get(address)
52: if result.status == Geocoding::GEO_SUCCESS
53: lat_long = result.first.latlon
54: lat_val = lat_long[0]

app/views/home/_home_left_content_area.html.erb:51
app/views/home/_home_left_content_area.html.erb:48:in `each'
app/views/home/_home_left_content_area.html.erb:48
app/views/home/home.html.erb:13
app/controllers/home_controller.rb:362:in `home'
passenger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.15) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application'
passenger (2.2.15) lib/phusion_passenger/utils.rb:252:in `safe_fork'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:in `spawn_rails_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application'
passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /home/neembusc/neembus/public/500.html (500 Internal Server Error)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文