NoMethodError in Tolk/locales#index | undefined method `count' for []:Array #5

SUzB opened this Issue May 7, 2010 · 5 comments


None yet

3 participants

SUzB commented May 7, 2010

Following error occurs after adding a new language xx.

Showing vendor/plugins/tolk/app/views/tolk/locales/index.html.erb where line #10 raised:

undefined method `count' for []:Array
Extracted source (around line #10):

7: <% @locales.each do |locale| %>
9: <%= link_to locale.language_name, locale %>
10: <% missing_count = locale.count_phrases_without_translation %>

SUzB commented May 7, 2010

After adding the language file xx.yml and running rake tolk:sync the error changes to:

undefined method `count' for #Array:0x287b868


James Brennan commented on this type of error:
"You're probably seeing this error because ruby 1.8.7 introduced count as a method on Array, whereas it does not exist in 1.8.6. Chances are production is running 1.8.6 or earlier."

SUzB commented May 8, 2010

Thanks for the hint. I am using ruby 1.8.6. Is there an easy way to update to the current ruby version?

lifo commented May 8, 2010
SUzB commented May 8, 2010

Upgrade from ruby 1.8.6 to 1.8.7 fixed it. Thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment