# Private method \`split' called for

**URL:** <https://www.ruby-forum.com/t/private-method-split-called-for/126554>\
**Category:** Rails\
**Created:** [January 19, 2008, 2:19pm UTC](https://www.ruby-forum.com/t/private-method-split-called-for/126554 "2008-01-19T14:19:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![philthompson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@philthompson](https://www.ruby-forum.com/u/philthompson)\
**Post date:** [January 19, 2008, 2:19pm UTC](https://www.ruby-forum.com/t/private-method-split-called-for/126554/1 "2008-01-19T14:19:54Z")

</div>

hi,

I’m trying to split a string up as follows:

> > @ruby = “I like carrots”  
> > =\> “I like carrots”
> 
> > @type = @ruby.split[2][0,@ruby.split[2].length-1]  
> > =\> “carrot”

which works fine in the console…but when I try to run it on my site, I  
get the error:

private method `split’ called for #List:0xb681084c

What could be the problem?

Thanks,

Phil.

---

<div class="post-metadata">

**Author:** ![philthompson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@philthompson](https://www.ruby-forum.com/u/philthompson)\
**Post date:** [January 19, 2008, 2:30pm UTC](https://www.ruby-forum.com/t/private-method-split-called-for/126554/2 "2008-01-19T14:30:50Z")

</div>

shit sorry, I’m a dooshbag, the problem isn’t a problem, the problem is  
my eye for detail. @ruby wasn’t assigned to a string in my code.
