puma

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

六月ゝ 毕业季﹏ 提交于 2019-12-07 14:48:20
问题 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:

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

自作多情 提交于 2019-12-07 09:55:02
问题 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,

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

谁都会走 提交于 2019-12-07 08:34:28
问题 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

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

久未见 提交于 2019-12-07 07:05:21
问题 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

Cannot run localhost:3000 : white empty page is rendered

笑着哭i 提交于 2019-12-07 02:26:48
问题 I am using Rails 4.2.6 and Ruby 2.3.0 and Puma 3.3.0 During the last couple days I ran some bundle update and after rails s all browsers for the same URL localhost:3000 are rendering the same blank page. This is consistent for all 6-7 applications I am playing with. However all are working in "production" when deployed to Heroku. Seems to be only a matter related to my dev env. Don't know how to solve this. Any help will be much appreciated. Can't continue development if can't run unit tests

Are there still benefits to running JRuby vs. the latest MRI with Puma?

廉价感情. 提交于 2019-12-07 00:28:57
问题 I'm considering updating our ruby interpreter to JRuby, it's been quite a headache because we've had to remove any 2.x specific syntax from our app and resort to ruby 1.9.3 compatibility. Which isn't the end of the world. When it came time to run the app, I found out that we cannot use Puma in clustered mode. The question is, given all the fixes and changes to MRI in the past few years, are the benefits of having "real threads" still valid? update To make this more objective, the question is,

What configuration for Rails 3.2.22.2 + Puma + Heroku?

喜夏-厌秋 提交于 2019-12-06 07:25:47
问题 I've read Richard Schneeman's article, and a bunch of other ones. ;-) I'm still struggling with this. Here's few gems I've added in my Gemfile to benchmark my app: gem 'airbrake' gem 'newrelic_rpm' gem 'stackprof' gem 'derailed', group: :development gem 'rack-mini-profiler' gem 'flamegraph' gem 'memory_profiler' gem "skylight" After a lots of benchmarks in development and in staging env, I know where my app is not fast enough but there's not memory leak (some small mem bloats sometimes maybe)

Deploying Ruby on Rails app to Heroku while using Action Cable (Puma port listening)

别来无恙 提交于 2019-12-06 07:08:07
问题 I have got Action Cable working in a local host environment and in this situation I start the Puma server using a simple file containing # /bin/bash bundle exec puma -p 28080 cable/config.ru Once this happens the puma server starts and is listening to this 28080 port and the port the local server is running on. Through hunting online I couldn't find a place that would tell me a way to emulate this on heroku or a way to have my server always start on the same port (though I don't know if that

Elastic Beanstalk: customize Puma configuration

我怕爱的太早我们不能终老 提交于 2019-12-06 04:55:18
问题 The current Beanstalk solution stack for Ruby + Puma uses the configuration file at /opt/elasticbeanstalk/support/conf/pumaconf.rb and ignores the config/puma.rb inside the Rails application directory. I could override the file above with a custom one via .ebextensions but am hesitant because I'd like to avoid breakage in case the path to the PID or - more importantly - unix socket files changes in upcoming solution stack versions. What is the best practice for customizing the Puma

HTTP parse error, malformed request - Ruby on Rails

好久不见. 提交于 2019-12-06 02:15:32
问题 I see the following error in Terminal when attempting to run a Ruby on Rails app. HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.> 2017-03-12 13:10:02 -0400: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"puma 3.4.0 Owl Bowl Brawl", "GATEWAY_INTERFACE"=>"CGI/1.2