-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rbenv support #486
Comments
Here's how I got cron jobs working for my Capistrano/rbenv/rails setup:
I commented out whenever in the Capfile, so I have to add new whenever cron jobs myself, after listing them in my development environment and modifying them to fit the pattern above. |
The |
I have the eval string in my .bashrc and it works fine otherwise. |
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi |
this post works for me for Ubuntu, on AWS: Eg for a periodical task each 15 minutes:
you can find your rbenv path to replace with 'which rake' command:
|
Ubuntu 16.04, rbenv, Capistrano, whenever, Rails 5
|
It took me hours to finally find this solution. @askrynnikov's solution did not work for me. I'm also on Ubuntu, rbenv, Capistrano, whenever, and Rails 5. All I needed to do was add |
@austinarchibald's comment worked for me, finally. There should really be a mention of this in the readme for RBENV users. Add to this the confusion of not really knowing about cron outputs, and it just failing silently...quite the fun 2 hours debugging this. |
This worked for me as well. And just like gregblass, it was quite an experience debugging this! I am not sure if I it is a fundamental misunderstanding of the capistrano rbenv gem or some issue with the gem itself, but I had similar issue with delayed_job, where the bin/delayed_job file just would not get the executable permission when copied to the server by capistrano. So I wrote a task which I had run before invoking the delayed_job:restart task. |
Actually, @javan gave an excellent explanation(#486 (comment)) of what is going on. However, in 2021, on Ubuntu 20.04 I had some mileage variation.
into |
On Ubuntu 20.04 this is at the top of
You could put |
Just reporting back RE #486 (comment) It worked well and now the commands run with the correct ruby environment. I'm not sure if it's an ideal setup since I don't like configurations that are order dependent but the default structure of this file gives us no choice. |
I can affirm that this solution works. Thank you @brendon |
I can't get the whenever bundler combination work in production.
I'm trying to change the cron jobs to include rbenv:
http://snippets.aktagon.com/snippets/601-running-and-debugging-cronjobs-with-rbenv-and-bundler
Is this something to consider?
The text was updated successfully, but these errors were encountered: