ActionView::Template::Error (undefined method `getlocal' for “2008-02-14T02:20:50Z”:String):-Collection of common programming errors
After updating Mongoid 3.0.1 / Rails 3.2.6 it start getting a ‘getlocal’ method error when displaying created_at :
Showing /home/lsoave/rails/github/gitwatcher/app/views/shared/_watch-list-table.html.haml where line #28 raised:
undefined method `getlocal' for "2008-02-14T02:20:50Z":String
Extracted source (around line #28):
28: %td= repo.created_at.to_s(:pretty)
UPDATE
I’ve got a config/initializers/time_formats.rb which set that format
$ cat config/initializers/time_formats.rb
Time::DATE_FORMATS[:month_and_year] = "%B %Y"
Time::DATE_FORMATS[:pretty] = lambda { |time| time.strftime("%a, %b %e at %l:%M") + time.strftime("%p").downcase }
anyway the error happen also by simply call repo.created_at
(omitting .to_s(:pretty))
UPDATE
I just tried a rollback, on RVM/Ruby – Rails – Mongoid stack without success :
from [email protected] to [email protected]
from Mongoid 3.0.1 to Mongoid 2.4.3
from Rails 3.2.6 to Rails 3.2.3
see RVM output :
[email protected]:~/rails/tests/gitwatcher$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
[email protected]:~/rails/tests/gitwatcher$ rvm list
rvm rubies
=> ruby-1.9.2-p290 [ i686 ]
* ruby-1.9.3-p194 [ i686 ]
# => - current
# =* - current && default
# * - default
[email protected]:~/rails/tests/gitwatcher$ rvm gemset list
gemsets for ruby-1.9.2-p290 (found in /home/lsoave/.rvm/gems/ruby-1.9.2-p290)
global
=> rails-3.2.3
[email protected]:~/rails/tests/gitwatcher$
… I guest that is something at ENV level at this point, but what ?
Originally posted 2013-11-09 19:45:12.