From: Dave B Date: 2009-04-18T01:03:13+09:00 Subject: [ruby-core:23237] [Bug #1387] first(0) and last(0) behavior Issue #1387 has been updated by Dave B. Those methods (for String) don't exist in Matz Ruby: puts 'ruby %s (%s) [%s]' % [RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM] p "abc".first(1) #ruby 1.8.6 (2008-08-11) [i386-mswin32] #tmp:3: undefined method `first' for "abc":String (NoMethodError) # ... neither in 1.9.1 ... #ruby 1.9.1 (2009-01-30) [i386-mswin32_90] # tmp:3:in `
': undefined method `first' for "abc":String (NoMethodError) A quick search finds they are added by Rails but maybe you have some other library which adds the methods. http://errtheblog.com/posts/42-rails-rubyisms-advent Either way, if you can't track them down, try asking on either the ruby-talk or Rails lists. daz ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1387 ---------------------------------------- http://redmine.ruby-lang.org