Rubyzip not recognized

Hello.

I have downloaded and installed rubyzip successfully. However, Ruby
does not recognize any of its classes.

The following is the code that I used (for practice):

  def getfiles (zipFileName)
    Zip::ZipFile.open(zipFileName, Zip::ZipFile::CREATE)
    Zip::ZipFile.foreach(zipFileName) do |file|
      placeFile(path_to_file, file)
    end
  end

..and this is the error that I received:

  test.rb:27:in `getfiles': uninitialized constant Song::Zip (NameError)
        from test.rb:55

Not sure if I used the classes and/or methods correctly, but it does not
seem to recognize Zip or ZipFile.

Can someone please tell me what I can do to fix this problem?

Danke!
Lisa

···

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

in the above snip doesn't show inclusion of the zip lib:

require 'zip/zip'

···

On Sat, Jun 10, 2006 at 09:41:44AM +0900, lisa umeda wrote:

Hello.

I have downloaded and installed rubyzip successfully. However, Ruby
does not recognize any of its classes.

The following is the code that I used (for practice):

  def getfiles (zipFileName)
    Zip::ZipFile.open(zipFileName, Zip::ZipFile::CREATE)
    Zip::ZipFile.foreach(zipFileName) do |file|
      placeFile(path_to_file, file)
    end
  end

..and this is the error that I received:

  test.rb:27:in `getfiles': uninitialized constant Song::Zip (NameError)
        from test.rb:55

Not sure if I used the classes and/or methods correctly, but it does not
seem to recognize Zip or ZipFile.

Can someone please tell me what I can do to fix this problem?

unknown wrote:

···

On Sat, Jun 10, 2006 at 09:41:44AM +0900, lisa umeda wrote:

      placeFile(path_to_file, file)

Can someone please tell me what I can do to fix this problem?

in the above snip doesn't show inclusion of the zip lib:

require 'zip/zip'

Ah hah! I didn't know how to include other libraries (didn't need to
for Rails, at least).

I apologize for my ignorance and thank you for the advice.

lisa

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