Tag: puma

动作电缆在本地订阅,但不在heroku上订阅

我一直在尝试在网上找到的所有东西,但没有任何工作。 希望一些新鲜的眼睛会看到这个问题。 这是我第一次使用ActionCable,一切都在本地很好用,但是在推送到heroku时。 我的日志不显示任何actioncable订阅,如我的开发服务器: [ActionCable] [email@email.com] MsgsChannel is streaming from msg_channel_34 当发送消息时,我确实看到[ActionCable] Broadcasting to msg_channel_34:但它们没有附加,我猜这意味着received方法没有被访问/调用? 我注意到在heroku的日志上它说Listening on tcp://0.0.0.0:5000在哪里作为开发人员在localhost:3000监听。 我应该以某种方式指向我的heroku app吗? 以下是相关的配置文件: Procfile: web: bundle exec puma -p 5000 ./config.ru actioncable: bundle exec puma -p 28080 cable/config.ru redis: redis-server ***感谢下面的评论,我也在努力。 仍然没有工作,但我可以看到它正在收听的端口正在发生变化,让我相信它与配置有关? : web: bundle exec puma -p $PORT ./config.ru actioncable: bundle exec puma -p $PORT cable/config.ru […]

带有Rails的Websockets(Puma) – WebSocket握手期间出错:意外的响应代码:200

我试图在我的Rails4.1应用程序中使用websocket 以下是一些相关的代码片段: 的Gemfile: gem ‘websocket-rails’ gem ‘puma’ development.rb config.middleware.delete Rack::Lock 我在本地启动服务器: bundle exec puma -p 3000 在chrome控制台中,我看到一个连接错误: new WebSocketRails(‘localhost:3000/post/hello’, true); WebSocket connection to ‘ws://localhost:3000/post/hello’ failed: Error during WebSocket handshake: Unexpected response code: 200 任何人都可以帮助我在Rails中本地使用Web套接字需要做什么? UPDATE1 当我在Unicorn服务器上运行时,我尝试按照我的Rails应用程序中不起作用的Websockets添加以下内容,但是在瘦服务器上运行但是它没有帮助 初始化/ eventmachine.rb Thread.new { EventMachine.run } unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive

puma生产服务器在后台:omniauth记录到stdout失败导致错误

我使用rails + puma作为我的生产服务器。 我使用httpd设置虚拟机并将请求转发给localhost:3000。 我用来启动我的puma服务器的命令是(已在app文件夹中) puma -e production -p 3000 & 当我仍然使用ssh登录服务器时,我的网络应用程序的一切都很好。 只有一些日志实际出现在屏幕上(我没注意它)。 但是,当我退出ssh会话时。 我不能使用omniauth(gem)。 我查看了服务器日志: Errno::EIO (Input/output error @ io_write – ): 我在网上寻找这个 – 这是一个IO连接问题,在我的情况下的原因应该是产生美洲狮的父进程已经完成但是puma试图记录它的东西。 所以我使用重定向,希望控制台没问题: puma -e production -p 3000 > log/console.log & 但问题仍然存在。 到目前为止,我认为它只与omniauth有关:它总是记录到stdout,即使我这样做“ https://github.com/intridea/omniauth/issues/583 ”。 所以现在我想我可以尝试更改omniauth的记录器或尝试“给stdout”到omniauth,即使它在后台运行 非常感谢:)

无法连接到AWS中的rails服务器

我整理了一个rails 5应用程序,并尝试从AWS ec2实例运行它。 我已经设置了安全组,但无法访问我选择的特殊端口。 可能有什么不对? 安全组设置: Ports Protocol Source rails-dev-and-ssh 80 tcp 72.21.xxx.0/24 ✔ 22 tcp 72.21.xxx.0/24 ✔ 3800 tcp 0.0.0.0/0 ✔ Puma服务器启动: [ec2-user@ip-172-31-42-206 Viewer]$ rails server -p 3800 -b 172.31.42.206 => Booting Puma => Rails 5.0.0.1 application starting in development on http://172.31.42.206:3800 => Run `rails server -h` for more startup options Puma starting in […]

如何调试ajax请求引发“错误R15(内存配额大大超出)”

我在Heroku上有一个Rails应用程序崩溃, Error R15 (Memory quota vastly exceeded) 。 我已经将此问题跟踪到包含多个异步请求的页面。 这些错误似乎与构建远程数据表的ajax请求一致。 问题是,我无法弄清楚为什么会出现这些错误。 我想也许ajaxified数据表后面的数据库查询和控制器操作可能运行缓慢。 但是,如果我使用miniprofiler在开发中检查这些,请求看起来非常有效。 然后我想,也许服务器正在接收多个同时发出的请求,这就是重载了heroku dyno。 但我把dynos提升到一个非常高的数字,仍然看到错误。 什么是开始识别和调试导致此内存错误的明智方法? 我以前不必解决这样的问题。

Capistrano不会创建puma.pid文件

我使用Capistrano来部署我的Rails应用程序。 但是,当我部署我的应用程序时,没有创建puma.pid文件,这会导致问题 – 我无法重新启动服务器或使用capistrano部署新版本 – capistrano无法停止puma ,因为puma.pid不会出现问题并假设没有puma进程正在运行。 当capistrano尝试运行另一个版本的puma时,我得到ADDRESS ALREADY IN USE错误。 这是我的deploy.rb lock ‘3.4.0’ set :application, ‘appname’ set :repo_url, ‘giturl’ set :deploy_to, ‘/home/user/appname’ set :pty, false set :linked_files, %w(config/application.yml config/database.yml) set :linked_dirs, %w(log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads) set :keep_releases, 5 set :rvm_type, :user set :rvm_ruby_version, ‘2.3.0’ set :puma_rackup, -> { File.join(current_path, ‘config.ru’) } […]

Capistrano-Puma没有启动Puma Server

问题面临 当我运行bundle exec cap production puma:start ,我得到了Puma成功启动的响应: DEBUG [e4382d1e] * Pruning Bundler environment DEBUG [e4382d1e] DEBUG [e4382d1e] [2599] Puma starting in cluster mode… DEBUG [e4382d1e] DEBUG [e4382d1e] [2599] * Version 3.0.2 (ruby 2.2.1-p85), codename: Plethora of Penguin Pinatas DEBUG [e4382d1e] DEBUG [e4382d1e] [2599] * Min threads: 0, max threads: 16 DEBUG [e4382d1e] DEBUG [e4382d1e] [2599] […]

capistrano部署后,ec2服务器中缺少puma.sock

在通过capistrano将生产ruby on rails项目部署到ec2上的实例后,我在nginx错误日志中收到以下错误。 亚马逊公共主机显示502 Bad Gateway nginx / 1.10.0(Ubuntu)。 我按照https://www.sitepoint.com/deploy-your-rails-app-to-aws/上的教程进行操作。当我运行cap生产部署时,似乎没有创建puma.sock。 2017/06/28 01:09:57 [crit] 12802#12802: *1 connect() to unix:/home/deploy/app_name/shared/tmp/sockets/puma.sock failed (2: No such file or directory) while connecting to upstream, client: 173.198.30.2, server: localhost, request: “GET / HTTP/1.1”, upstream: “http://unix:/home/deploy/app_name/shared/tmp/sockets/puma.sock:/”, host: “host” 以下是我的deploy.rb set :application, ‘app_name’ set :repo_url, ‘git@github.com:github_account/app_name.git’ # Edit this to match your repository […]

更改密码后用户会话无效,但只有多个线程

我的Rails 4 + Devise 3.2应用程序中的一个function遇到了一个奇怪的问题,它允许用户通过AJAX POST将其密码更改为以下操作,该操作源自Devise wiki 允许用户编辑其密码 。 似乎在用户更改密码之后以及之后的一个或多个请求之后,它们将被强制注销,并在重新登录后继续被强制注销。 # 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[:old_password]) @user.password = params[:new_password] @user.password_confirmation = params[:new_password_conf] if @user.save sign_in @user, :bypass => true head :no_content return end else render :json => { “error_code” => “Incorrect password” […]

配置Puma和Sidekiq

可能更多的是试图克服学习曲线+实际代码问题。 如果它看起来很有问题,我道歉,目前我在生产中遇到这个错误。 基本上我一直在接受这个“redis池太小”而且我迷失了从哪里开始,我实际上已经失去了基本上理解如何准确配置sidekiq与puma或配置之后的任何东西如缩放等。 下面我有我的配置跟随我收到的错误。 ProcFile web:bundle exec puma -C config / puma.rb worker:bundle exec sidekiq -e production -Cconfig / sidekiq.yml Sidekiq初始 if Rails.env.production? Sidekiq.configure_client do |config| config.redis = { url: ENV[‘REDIS_URL’], size: 2 } end Sidekiq.configure_server do |config| config.redis = { url: ENV[‘REDIS_URL’], size: 20 } Rails.application.config.after_initialize do Rails.logger.info(“DB Connection Pool size for Sidekiq Server […]