i want to make a cronjob which execute a specific ruby file in the script directory of my rails app. how can i achieve, that i can execute an actionmailer to use deliver? how do i get this mailer into this ruby file?
thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Skipping the part about creating a task in crontab, here is what you can do:
Load the Rails environment explicitly in your ruby script. I do this in some daemons.
You can do something like this :
Use the rails runner.
rails runner -hwill give you the necessary information