Bugger!!!

talk about looking like a f00l :)

saved code below as Song.rb

class Song
  def initialize(name, artist, duration)
    @name     = name
    @artist   = artist
    @duration = duration
  end
end

tried it with Song.rb and got this

     ruby Song.rb

     >ruby Song.rb
     >Exit code: 0

Which i would expect to be something that's worked as expected.
Now if i pass parameters to it as in

     ruby Song.rb("here","come frank",60)
     >ruby Song.rb("here","come frank",60)
     ruby: No such file or directory -- Song.rb(here,come frank,60) 
(LoadError)
     >Exit code: 1

so i expect this is where the error is the parameters aren't know to the 
program
and i get the LoadError.

Lyle could you confirm this to me?

I'm trying to copy from the ruby book that comes with ruby 1.8.6 win32.

thanks for the well enlightened response. Wasn't trying to be silly, but 
was a bit tried (in my defense) :).

dave.


Lyle Johnson wrote:
> On 6/22/07, Dave Lilley <dglnz / yahoo.com> wrote:
> 
>> this i saved as Song.rb
>> In the output window i type ruby aSong.rb
>> and get
>> ruby aSong.rb
>> >ruby aSong.rb
>> ruby: No such file or directory -- aSong.rb (LoadError)
>> >Exit code: 1
> 
> You saved the file as "Song.rb" and you're trying to run a file named
> "aSong.rb". Do you *seriously* not understand what you're doing wrong?


-- 
Posted via http://www.ruby-forum.com/.