tags:

views:

255

answers:

1

I'm trying to run a ruby script from cron, the script uses bundler to manage gem dependencies, since cron does not run in $PWD I get a 'Could not locate Gemfile' error form bundler every time, which makes sense since Gemfile is not in the currrent path when running from cron.

Is there a way to tell bundler to use a Gemfile not in the current path?

+1  A: 

The best thing to do would be to cd into the directory in question in your cron. You could also use the BUNDLE_GEMFILE environment variable to point at the Gemfile. Please let us know (at http://github.com/carlhuda/bundler/issues) if you have any problems with BUNDLE_GEMFILE.

Yehuda Katz
Camilo