Spring server: timeout error

I am trying to start a cron task using the Rails schedule.rb file. The task calls a function written in ruby. The function works fine. However, when I try to run as a cron, I get this error.

Starting Spring server with `/home/ubuntu/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/bin/spring server --background` timed out after 20 seconds

      

Spring (2.0.2) is installed and working fine. Any idea how to solve this?

+3


source to share


1 answer


If the command is running outside of cron but not in crontab, the problem is almost certainly that the command is not typing some of the required environment variable settings. There are several ways to work around the problem, but the simplest and best is to wrap your command in a shell script .

For initial testing, you can simply specify your login environment:



. ~/.bash_profile 

      

But in the end you just need to set the variables you want and not include anything extra. For more information, see Define Your Own Job Types .

0


source







All Articles