2

The shoryuken gem is a background worker for rails applications that reads from aws SQS.

I can run the shoryuken worker in my local and it's working fine. When I run it in production environment in AWS it does not work. How do you run shoryuken in production environment? I'm also thinking that this might be an issue with my aws security groups. We are using VPC. Should I allow the SQS port? If so, what port is SQS running in? I also wonder why it's asking about port 5432 which is the port of our Postgres DB.

bundle exec shoryuken -r path_to_my_worker.rb -C config/shoryuken.yml --rails RAILS_ENV=production

could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
dimid
  • 7,285
  • 1
  • 46
  • 85
tungsten_carbide
  • 525
  • 5
  • 18

2 Answers2

3

Try passing RAILS_ENV=production before shoryuken. If you pass it after, it won't work.

RAILS_ENV=production bundle exec shoryuken -r path_to_my_worker.rb -C config/shoryuken.yml --rails
Pablo Cantero
  • 6,239
  • 4
  • 33
  • 44
0

It turns out that shoryuken is loading my development environment in aws. When I copied my settings from production to development in the database.yml, it worked. It does not seem right. I don't know how to pass a command to make it run in production mode. I tried "RAILS_ENV=production" and "-e production" already, no effect on shoryuken.

tungsten_carbide
  • 525
  • 5
  • 18