# Problems with id3lib-ruby

**URL:** <https://www.ruby-forum.com/t/problems-with-id3lib-ruby/77997>\
**Category:** Ruby\
**Created:** [December 2, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/problems-with-id3lib-ruby/77997 "2006-12-02T12:41:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c89c15/32.png) [@Bira](https://www.ruby-forum.com/u/Bira)\
**Post date:** [December 2, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/problems-with-id3lib-ruby/77997/1 "2006-12-02T12:41:08Z")

</div>

Hello,

I’m trying to organize my MP3 collection using id3lib-ruby, to go  
through it and sort the files into artist/album folders according to  
their ID3 information.

However, in some files, my script breaks with the following message:

undefined method ‘get\_type’ for nil:NilClass

The message corresponds to the following line:

tag = ID3Lib::Tag.new(mp3)

‘mp3’ is a variable holding the name of the file being currently  
processed.

After a bit of testing and looking at the documentation for the “new”  
method, it seems this happens because a given file may have some  
invalid frames in its tag, or no frames at all (i.e, no tag).

Does anyone know if this is a bug or simply user error on my part? If  
it is a bug, I’ll gladly report it on rubyforge, but if it’s user  
error I’d like to know the correct way to go about this :).

---

<div class="post-metadata">

**Author:** ![Bira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c89c15/32.png) [@Bira](https://www.ruby-forum.com/u/Bira)\
**Post date:** [December 2, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/problems-with-id3lib-ruby/77997/2 "2006-12-02T14:19:18Z")

</div>

Bira schrieb:

> The message corresponds to the following line:  
> it is a bug, I’ll gladly report it on rubyforge, but if it’s user  
> error I’d like to know the correct way to go about this :).

Hi,

It’s a known bug, the tracker item is here:  
[http://rubyforge.org/tracker/index.php?func=detail&aid=6446&group\_id=1384&atid=5449](http://rubyforge.org/tracker/index.php?func=detail&aid=6446&group_id=1384&atid=5449)

The problem is fixed in SVN. It would be nice if you could try it out  
and post your results to the tracker item above. Here’s what you would  
have to do:

svn checkout svn://rubyforge.org/var/svn/id3lib-ruby/branches/0/  
id3lib-ruby  
cd id3lib-ruby  
rake ext  
ruby -Ilib:ext -rid3lib -e ‘ID3Lib::Tag.new(ARGV.first)’ /path/to/mp3

Or you could wait for 0.4.2. Anyway, thanks for reporting :).
