From: Stefano Crocco Date: 2011-08-07T23:36:37+09:00 Subject: Re: Running system() and suppressing errors On Sunday 07 August 2011 23:23:05 Marc Heiler wrote: > Hi, > > Simple question. > > Say I do this from a .rb script: > > system "gedit README" > > Right now I get a warning: > > Gtk-WARNING **: Locale not supported by C library.Using the fallback > 'C' locale. > > I don't want or need this warning. > > Is there a way to suppress it completely? > > I tried by: > > system "gedit README 2>&1" > > To no avail. > > Any ideas? Redirecting stderr to stdout won't solve your problem, as system prints stdout on screen (unlike the backtick operator which stores the output in a variable). To avoid displaying it, you should redirect it to /dev/null. system "gedit README 2>/dev/null" I hope this helps Stefano