puma

Puma - Rails on linux // Restart when process dies

戏子无情 提交于 2019-12-05 22:34:56
Using puma on a rails app; it sometimes dies without any articular reason; also often dies (does not restart after being stopped) when deployed What would be a good way to monitor if the process died, and restart it right way ? Being called within a rails app; I'd be useful to have a way to defines it for any apps. I did not found any useable ways to do it (looked into systemd, other linux daemons… no success) Thanks if any feedback You can use puma control to start/stop puma server. If you know where puma.pid file placed (for Mac it's usually "#{Dir.pwd}/tmp/pids/puma.pid" ) you could do:

Rails + Puma + Nginx Every couple of days Bad Gateway 502

主宰稳场 提交于 2019-12-05 22:05:10
I have a rails app running on Nginx with Puma and like clockwork, every couple of days the app goes down with a 502 Bad Gateway error. My nginx log contains lots of errors like this: 2015/07/23 14:43:49 [error] 14044#0: *7036 connect() to unix:///var/www/myapp/myapp_app.sock failed (111: Connection refused) while connecting to upstream, client: 12.123.12.12, server: myapp.com, request: "GET /arrangements HTTP/1.1", upstream: "http://unix:///var/www/myapp/myapp_app.sock:/arrangements", host: "myapp.com", referrer: "http://myapp.com/arrangements" I have to restart Puma and everything works again

rails nginx puma duplicate upstream “puma” in /etc/nginx/sites-enabled

霸气de小男生 提交于 2019-12-05 18:56:22
I've set up my server for this tutorial ( https://coderwall.com/p/ttrhow/deploying-rails-app-using-nginx-puma-and-capistrano-3 ) When I used one project, all works, but when I added another project to this VPS, I have error [emerg] 20737#0: duplicate upstream "puma" in /etc/nginx/sites-enabled/vsejalreg:1 My nginx's configure upstream puma { server unix:///home/deployer/apps/vsejalreg/shared/tmp/sockets/vsejalreg-puma.sock; } server { listen 80; server_name wjreg.rubyserv.ru www.wjreg.rubyserv.ru; root /home/deployer/apps/vsejalreg/current/public; access_log /home/deployer/apps/vsejalreg

Puma restart fails on reboot using EC2 + Rails + Nginx + Capistrano

天大地大妈咪最大 提交于 2019-12-05 18:11:51
I have successfully used capistrano to deploy my rails app to Ubuntu EC2. Everything works great on deploy. Rails app name is deseov12 My issue is that Puma does not start on boot which will be necessary as production EC2 instances will be instantiated on demand. Puma will start when deploying via Capistrano, it will also start when running cap production puma:start on local machine. It will also start on server after a reboot if I run the following commands: su - deploy [enter password] cd /home/deploy/deseov12/current && ( export RACK_ENV="production" ; ~/.rvm/bin/rvm ruby-2.2.4 do bundle

action cable subscribing locally, but not on heroku

浪尽此生 提交于 2019-12-05 16:56:45
问题 I've been trying everything I can find online, and nothing is working. Hoping some fresh eyes will see the issue. This is my first time using ActionCable, and everything works great locally, but when pushing to heroku. my logs do not show any actioncable subscriptions like my dev server: [ActionCable] [email@email.com] MsgsChannel is streaming from msg_channel_34 and when sending a message, I do see [ActionCable] Broadcasting to msg_channel_34: but they are not appending, which I'm guessing

Configuring Puma and Sidekiq

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 16:23:43
Might be more of trying to overcome a learning curve + actual code question. I apologize if it seems nubish, currently I get this error within production. Basically I keep recieving this "redis pool is too small" and I'm lost where to start, I'm actually lost on basically understanding how to accurately configure sidekiq with puma or anything that comes after configuration like scaling etc. Below I have my configuration followed my error I recieve . ProcFile web: bundle exec puma -C config/puma.rb worker: bundle exec sidekiq -e production -C config/sidekiq.yml Sidekiq init if Rails.env

Thread running in Middleware is using old version of parent's instance variable

白昼怎懂夜的黑 提交于 2019-12-05 15:20:12
I've used Heroku tutorial to implement websockets. It works properly with Thin, but does not work with Unicorn and Puma. Also there's an echo message implemented, which responds to client's message. It works properly on each server, so there are no problems with websockets implementation. Redis setup is also correct (it catches all messages, and executes the code inside subscribe block). How does it work now: On server start, an empty @clients array is initialized. Then new Thread is started, which is listening to Redis and which is intended to send that message to corresponding user from

User sessions invalid after changing password, but only with multiple threads

半腔热情 提交于 2019-12-05 14:37:58
I'm running into a strange problem with a feature in my Rails 4 + Devise 3.2 application which allows users to change their password via an AJAX POST to the following action, derived from the Devise wiki Allow users to edit their password . It seems that after the user changes their password and after one or more requests later, they are forcible logged out, and will continue to get forced logged out after signing back in. # POST /update_my_password def update_my_password @user = User.find(current_user.id) authorize! :update, @user ## CanCan check here as well if @user.valid_password?(params[

“We're sorry, but something went wrong” : rails + nginx + puma + digitalocean + ssl

杀马特。学长 韩版系。学妹 提交于 2019-12-05 13:52:31
I just successfully configured ssl on my rails app on the production server, but now, when I try to access the site I got "We're sorry, but something went wrong." error: If I disable ssl by not using any ssl setting, my Rails app will run just fine. It's only when I use the ssl setting, that I will have this problem. Which suggest that there is nothing wrong with my Rails code or something. I already checked these logs files : " production.log puma.access.log puma.error.log " but there are nothing there except for : === puma startup: 2017-02-08 21:18:32 +0000 === * Listening on unix:///home

Setting up multiple rails apps using nginx and Puma

醉酒当歌 提交于 2019-12-05 12:11:53
I have a web server serving multiple Rails applications using a combination of nginx and Passenger. This is pretty straightforward, because the Passenger install sets-up pretty much everything you need to connect to nginx. I found " Rails app with Puma " that seems to explain how to set up nginx and Puma together. How would this configuration need to be modified in order to serve a second Rails application on the same server? Also, this guide doesn't say anything about restarting the application automatically if there is a system reboot or some other issue. Is there a way to do that? The nginx