Topic: Creating dynamic image text?

How do I create dynamic image text?

I have a blank image (say a png 300 x 20 px.) that I want to fill with some text. This has to be done dynamically, as the text will be defined by the user in a form.

How do I do this?
I have tried with:

image = Magick::ImageList.new("#{RAILS_ROOT}/public/#{image_path}".gsub("//", "/"))
image.display

but this fails, and raises an error: "unable to open X server `' @ display.c/DisplayImages/1654"

I have looked around and the only explanation for the error was that I needed to start X11 to display the picture. Can this really be or am I missing something?

I am aware that the code doesn't currently write any text to the image, so I also would like to know if anybody has a good way to do this?

// Emil Kampp
    Web programmer and adventure guide, so a little for every taste.