Private method `split' called for

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.

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.

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