From: Brian Candler Date: 2012-09-13T06:47:56+09:00 Subject: Re: How to run File Operation as sudo sharmin malik wrote in post #1075694: > f=File.new("/etc/fstab","a+") > f.puts entry > > now problem is , > I am running the script as not root user ,,now its failing because the > user does not root priviligies > > now how will do this ?? > > can i run that ruby module as sudo ?? Start your script using sudo ruby myscript.rb You can't gain root privileges mid-script, short of system("sudo ruby anotherscript.rb") -- Posted via http://www.ruby-forum.com/.