Railsアプリケーションにレーキタスクがあります。inrakeタスクでコマンドラインコマンドを実行したい。これどうやってするの。私は次のことを試しましたが失敗します
desc "Sending the newsletter to all the users"
task :sending_mail do
run "cd #{RAILS_ROOT} && ar_sendmail -o -t NewsLetters -v"
system "cd #{RAILS_ROOT} && ar_sendmail -o -t NewsLetters -v &"
end
上記のrunコマンドはrunmethodundefinedをスローし、Systemコマンドはエラーをスローしませんが実行されません。