Problem in active_support/string/access.rb?

There is this:

      def first(limit = 1)
        chars[0..(limit - 1)].to_s

but in console when I try it I get:

NoMethodError: undefined method []' for #<Enumerable::Enumerator: 0x2242b90> from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/core_ext/string/access.rb:43:infirst’
from (irb):1

because it is doing “test”.chars[0…0]

Or am I missing something here?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs