Forum: Ruby rubyzip not recognized

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Lisa U. (Guest)
on 2006-06-10 04:41
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
unknown (Guest)
on 2006-06-10 04:49
(Received via mailing list)
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'
lisa umeda (Guest)
on 2006-06-10 05:08
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
This topic is locked and can not be replied to.