title: How to execute commands within Rake tasks?
body: <p>I have the rake tasks in my rails application. i want to run a commandline commands with in rake task. how can i do this. i tried by the following but fails </p>
  
  <pre><code>desc "Sending the newsletter to all the users"
  task :sending_mail do
    run "cd #{RAILS_ROOT} &amp;&amp; ar_sendmail -o -t NewsLetters -v"
    system "cd #{RAILS_ROOT} &amp;&amp; ar_sendmail -o -t NewsLetters -v &amp;"
  end
  </code></pre>
  
  <p>The above run command throws run method undefined &amp; System command not throwing any errors but not executed.</p>