# Problem in active\_support/string/access.rb?

**URL:** <https://www.ruby-forum.com/t/problem-in-active-support-string-access-rb/144930>\
**Category:** Rails\
**Created:** [August 4, 2008, 1:53pm UTC](https://www.ruby-forum.com/t/problem-in-active-support-string-access-rb/144930 "2008-08-04T13:53:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e95f7d/32.png) [@phil](https://www.ruby-forum.com/u/phil)\
**Post date:** [August 4, 2008, 1:53pm UTC](https://www.ruby-forum.com/t/problem-in-active-support-string-access-rb/144930/1 "2008-08-04T13:53:22Z")

</div>

There is this:

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

```

but in console when I try it I get:

> > “test”.first  
> > 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:in`first’  
> > from (irb):1

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

Or am I missing something here?
