Rails:RuntimeError:在迭代期间无法将新密钥添加到哈希中

时间:2017-03-26 16:01:57

标签: ruby-on-rails ruby heroku thread-safety puma

在我的rails 4.2.7应用程序上以部署模式在Heroku上部署的puma上运行2个worker和8个线程,我在Rollbar中收到以下错误。我的内存使用率也很高,有时会超过1x dyno的限制。

RuntimeError: can't add a new key into hash during iteration
File "/app/app/views/shared/_navigation.html.haml" line 4 in block in _app_views_shared__navigation_html_haml___3017256416239853871_69904621111460
+ 8 non-project frames

这是代码块,提到行

= link_to root_url, class: 'logo', rel: 'home', itemprop: 'logo', itemscope: true, itemtype: 'https://schema.org/ImageObject' do
  = image_tag 'logo', alt: '9curry', title: 'AppName', itemprop: 'url'
  %meta{ content: '264', itemprop: 'width' }
  %meta{ content: '73', itemprop: 'height' }
%meta{ content: root_url, itemprop: 'url' }
%meta{ content: 'AppName', itemprop: 'name' }

以下代码块会抛出类似的错误

.play-store
  = link_to '#', rel: 'nofollow' do
    = image_tag 'google-play-badge', width: 200

0 个答案:

没有答案