Topic: Rails/Sqlite3 keeps multiple db files open?

I can't figure out exactly who's to blame here, maybe you guys can help.

On one particular server (Mac OS X Server 10.4.9, Ruby 1.8.5, Rails 1.2.2 & Sqlite3 3.3.13 installed by DarwinPorts), either Ruby or Sqlite3 isn't closing database files after operating on them. Any browser-based operation opens the DB and leaves it open in memory. Eventually, when 100 or so files are open at once, the Rails server will crash and issue "Status: 500 Internal Server Error".

I can monitor the damage using lsof:

[xserve2:~/GuestList] scott% lsof | grep development
ruby    4753 scott    5w    VREG      14,19    7488058  3515249 /Users/scott/GuestList/log/development.log
ruby    4753 scott    8u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott    9u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   10u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   11u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   12u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   13u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   14u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   15u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   16u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   17u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   18u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   19u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   20u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   21u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   22u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   23u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   24u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   25u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   26u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development
ruby    4753 scott   27u    VREG      14,19     373760  3532097 /Users/scott/GuestList/GuestList_development

and so on. The list continues to grow until it throws an error. I can recover by killing the process and starting over.

For the sake of troubleshooting, I've tested new and existing projects with admin users and as root. I also have the same setup running on a variety of other OS's, including another Mac OS X Server installation, without any such issues.

Any idea what's going on here? What else can I do to troubleshoot?