God not running: The server is not available (or y

2019-03-31 01:43发布

问题:

I'm attempting to get god to start up my resque queue. However when I run god load config/resque.god it returns The server is not available (or you do not have permissions to access it)

This is my resque.god file:

rails_env   = ENV['RAILS_ENV']  || "production"
rails_root  = ENV['RAILS_ROOT'] || "/Users/andrewlynch/sites/wellness/wellbot"
God.watch do |w|    
 w.name     = "resque-worker"
 w.group    = "resque"
 w.interval = 60.seconds
 w.dir = "#{rails_root}"
 w.start    = "RAILS_ENV=development QUEUE=* rake resque:work"
 w.start_grace = 30.seconds   
end

回答1:

god load is use for loading or reloading configurations into an already running instance.

In your case, your god server is not running.

Here's the command to run god:

god -c config/resque.god


回答2:

Check out who the god service is running as by doing: ps aux | grep god

There's a good chance you'll see god running as root.

If you stop this service is restart by the same user as your running resque you should no longer see this error.