From: Scott D_o Date: 2006-10-17T12:38:14+09:00 Subject: Re: using classes problem Satish Talim wrote: > Ok so here is some code that is having the problem with the require. I > tested out some programs from rubyforge, and it gave me the same error. > ------------------------------ >> ----------------------------------------------------------------- >> ClassTester >> ----------------------------------------------------------------- >> require 'TestClass' >> >> ob = TestClass.new() >> puts("Testing: #{ob.testMethod()}") >> ----------------------------------------------------------------- >> > > It works for me. Both the program files are in the same folder. > > Here's a slightly modified code (normally the () is not there after the > method name. We use lowercase characters for method names and _ > character to > separate out the multi-words in a method name. I am also using > single-quotes > for plain strings (the first case in your program). > > # testclass.rb > class TestClass > def test_method > 'Hello I am in TestClass' > end > end > > # classtester.rb > require 'testclass' > ob = TestClass.new > puts("Testing: #{ob.test_method()}") > > The output - >>ruby classtester.rb > Testing: Hello I am in TestClass >>Exit code: 0 > > Hope this helps. Nope it still gives me the same error. IDK what to do, cause I tried it on two computers and they both give me the same one. On both computers I installed ruby using the 1click installer, do you think this would have any effect on it, or are there certain config files that I can check to make sure everything is in order? Thanks -- Posted via http://www.ruby-forum.com/.