I\'m trying to run a simple ruby script on my old PPC machine running 10.5 in an RVM environment.
Searching on SO, I\'ve followed the chosen answer from this post.>
To load default RVM ruby environment for cron
jobs, here is what I setup for user-mode RVM, assume the user is ohho
, home folder is /home/ohho
. To edit, enter crontab -e
in command line:
MAILTO=""
SHELL=/bin/bash
BASH_ENV=/home/ohho/.bash_profile
HOME=/home/ohho
* * * * * rails -v > /home/ohho/env.txt
The last line is for testing rails
(if installed) can be invoked properly. You should also check whether ~/.bash_profile
loads the RVM environment (which is default for bash).
A detail explanation of SHELL
and BASH_ENV
can be found in Daniel's answer.