From: "Jesús Gabriel y Galán" Date: 2008-09-02T15:00:26+09:00 Subject: Re: how can I exit with a message in ruby? On Tue, Sep 2, 2008 at 7:43 AM, Lex Williams wrote: > hi guys ! > > does ruby have a die method ? or is it there a method that displays a > string before exiting ? Kernel#at_exit You can register handlers that get executed when the program exits. at_exit {puts "Dying"} puts "In the program" You can build your own method to print, such as: module Kernel def print_at_exit str at_exit {print str} end end print_at_exit "goodbye" Jesus.