FFmpeg is capable of converting single images to a .flv movie. This is how it's done.
FFmpeg is a command line tool which is very powerful and widely accepted. (Even video professionals like putpat.tv use that.) The documentation can be found here.
There is also a ffmpeg gem for Ruby. This is a DSL that should make your life easier.
But:
It is no slideshow library. You don't have a slideshow user interface, you can just create a movie out of it.
For slideshows, the best available solution (imho) is Scribd.com. It can convert slideshows from various formats and provides a nice user interface. You probably would have to join the jpegs in another format first. (PDF?) Then, there is also a plugin available for Ruby (scribd-fu). However, it is not intended to be stored in a database.
Thus, I cannot provide the perfect solution to you. And I would be curious about better recommendations...