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

Closed
SUzB opened this Issue May 7, 2010 · 5 comments

Projects

None yet

3 participants

@SUzB
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
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

@jangerrit

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
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
Collaborator
lifo commented May 8, 2010
@SUzB
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