似乎对我不起作用。我在Github上打开了一个问题,但是我想要仔细检查一下我是不是做了一些愚蠢的事情。使用Rails 3.2.8和Ruby 1.9.3。 Here's the API reference
» bundle exec rails c
Loading development environment (Rails 3.2.8)
1.9.3-p194 :001 > helper.distance_of_time_in_words_to_now("2012-10-18")
ArgumentError: wrong number of arguments (2 for 1)
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/letters-0.2.6/lib/letters/core_ext.rb:155:in `t'
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_view/helpers/date_helper.rb:93:in `block in distance_of_time_in_words'
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/core_ext/object/with_options.rb:41:in `with_options'
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_view/helpers/date_helper.rb:73:in `distance_of_time_in_words'
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_view/helpers/date_helper.rb:133:in `time_ago_in_words'
from (irb):1
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /Users/davidtuite/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
答案 0 :(得分:0)
letters
gem与在t
帮助程序中使用的Rails distance_of_time_in_words
方法冲突。
有关详情,请参阅信函网站上的this explanation。