I'm assuming what you want to do is run a script (which you have saved in the cron
folder) as a cronjob, but you want it to load the Rails environment, including access to your ActiveRecord models, before it runs.
If this is the case, what you want to use is the script/runner
script in your Rails app, supplying it with the name of the script you want to run, e.g.
script/runner cron/my_cron_script.rb
If you want to add this as a cronjob, add it to your crontab as follows. Edit your crontab with the crontab -e
command and put something like the following there:
* * * * * /path/to/my/app/script/runner /path/to/my/app/cron/my_cron_script.rb