title: can not run sudo in a rails resque worker
body: <p>I have a resque worker which will run some shell command.</p>
  
  <p>for example</p>
  
  <p><code>ruby
  `sudo echo "XXX" &gt;&gt; xx.log`
  </code></p>
  
  <p>but when worker run, will raise below error</p>
  
  <p><code>
  sudo: no tty present and no askpass program specified
  </code></p>
  
  <p>I have add 'whoami' debug code to find which user run this sudo command,
  and also set this user's group "test" when execute command will don't need password.
  I'm also run same command in shell console, it works right, don't need input password.</p>
  
  <p>sudo visudo</p>
  
  <p><code>
  %test ALL=NOPASSWD:ALL
  </code></p>
  
  <p>but when the worker run sudo, will says above error, require input password.</p>
  
  <p>Who can tell me why?
  Thanks.</p>