From: Maung Aung Date: 2007-07-03T04:57:55+09:00 Subject: Re: String usage never mind, I figured that out because I was using it as class variable and I didn't instantiate the object. Thanks. Maung Maung Aung wrote: > Hi all, > I have a question about string usage. I assign @test_string class > variable which is assigned the name of a text file. > @test_string = 'file.txt' > When I was trying to use it as a parameter in a statement > info=File.open(@test_string) {|f| f.read.split}, > it said "TypeError: can't convert nil into String". I check the type of > @test_string and it said String object. What am I missing? > > Then I try to use to_s method, and it said "Errno::ENOENT: No such file > or directory - " > > Could someone explain what is going here? Pls kind on me as I am new to > Ruby. > > Thanks, > Maung -- Posted via http://www.ruby-forum.com/.