Tag: puma

在Heroku上一起使用Resque,Puma和Scheduler

在审查了许多指南之后,我想确认一下我的设置。 现在我的procfile看起来像: web: bundle exec puma -C config/puma.rb config.ru resque: TERM_CHILD=1 RESQUE_TERM_TIMEOUT=10 QUEUES=* bundle exec rake resque:work worker: bundle exec rake resque:work COUNT=1 QUEUE=* scheduler: bundle exec rake resque:scheduler ……在Heroku : …和我的rake resque设置任务 : require ‘resque’ require ‘resque/tasks’ require ‘resque/scheduler/tasks’ # http://jademind.com/blog/posts/enable-immediate-log-messages-of-resque-workers/ namespace :resque do desc ‘Initialize Resque environment’ task setup: :environment do ENV[‘QUEUE’] ||= […]

Windows上的Puma安装错误

我想在Windows机器上安装puma gem。 我收到以下错误。 经过几个论坛但是徒劳无功。 C:/railsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb creating Makefile make generating puma_http11-i386-mingw32.def compiling http11_parser.c ext/http11/http11_parser.rl: In function ‘puma_parser_execute’: ext/http11/http11_parser.rl:111:3: warning: comparison between signed and unsigned integer expressions compiling io_buffer.c io_buffer.c: In function ‘buf_to_str’: io_buffer.c:119:3: warning: pointer targets in passing argument 1 of ‘rb_str_new’ differ in signedness c:/RailsInstaller/Ruby2.0.0/include/ruby-2.0.0/ruby/intern.h:668:7: note: expected ‘const char *’ but argument is of […]

使用Rails和Puma与子域lvh.me?

我正在使用带有子域的Rails 4,现在从Unicorn切换到Puma。 似乎工作正常,但当我尝试启动“rails s”时,我得到: Rails 4.2.0 application starting in development on http://localhost:3000 我需要运行以下内容 rails s -p 3000 -b lvh.me 要得到: Rails 4.2.0 application starting in development on http://lvh.me:3000 有没有办法让’rails s’始终自动启动lvh.me? 在切换到Puma之前,我常常为我工作。

为什么gitlab 6切换回独角兽?

Gitlab 6.0于昨天发布。 我很想知道为什么他们从Puma转向Unicorn 。 5之前的版本使用Unicorn 。 我觉得切换到Puma是为了更好。 这个开关有技术原因吗?

Heroku上的Puma Cluster配置

我在RoR4 Heroku应用程序上配置Puma(multithreading+多核服务器)需要一些帮助。 Heroku上的文档并不是最新的。 我遵循了这个:配置的并发和数据库连接 ,没有提到集群的配置,所以我不得不同时使用这两种类型(线程和多核)。 我目前的配置: ./Procfile web: bundle exec puma -p $PORT -C config/puma.rb ./config/puma.rb environment production threads 0,16 workers 4 preload_app! on_worker_boot do ActiveRecord::Base.connection_pool.disconnect! ActiveSupport.on_load(:active_record) do config = Rails.application.config.database_configuration[Rails.env] config[‘reaping_frequency’] = ENV[‘DB_REAP_FREQ’] || 10 # seconds config[‘pool’] = ENV[‘DB_POOL’] || 5 ActiveRecord::Base.establish_connection end end 问题: a)我是否需要像Unicorn一样的before_fork / after_fork配置,因为群集工作者是分叉的? b)如何根据我的应用程序调整我的线程数 – 将它放下的原因是什么? /在什么情况下它会有所作为? 是不是已经优化了0:16? […]

在Windows上安装Puma错误

尝试在Windows上安装Puma并收到此错误 – Temporarily enhancing PATH to include DevKit… Building native extensions with: ‘–with-opt-dir=c:\openssl’ This could take a while… ERROR: Error installing puma: ERROR: Failed to build gem native extension. C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb –with-opt-dir=c:\openssl checking for BIO_read() in -lcrypto… no checking for BIO_read() in -llibeay32… no *** extconf.rb failed *** Could not create Makefile due to some […]

我如何使用puma的配置文件?

我按照本指南记录了存储在app的config目录中的puma.rb文件。 该指南有点夸张,但这是我认为puma.rb文件的作用。 而不是像这样运行疯狂的命令来让puma在指定的套接字上运行: bundle exec puma -e production -b unix:///var/run/my_app.sock 您可以在puma.rb文件中指定端口,pid,会话和其他参数,如下所示: rails_env = ENV[‘RAILS_ENV’] || ‘production’ threads 4,4 bind “/home/starkers/Documents/alpha/tmp/socket” pidfile “/home/starkers/Documents/alpha/tmp/pid” state_path “/home/starkers/Documents/alpha/tmp/state” activate_control_app 然后你可以进入应用程序的root并运行一个简单的命令 “彪马” 并且将遵循在puma.rb设置的参数。 不幸的是,这似乎对我不起作用。 至少,我在一个小测试应用程序的根目录中运行puma ,并且没有.sock文件出现在/home/starkers/Documents/alpha/tmp/sockets那么这是否意味着它不起作用? 我该如何工作? 我在本地开发机器上,所以可能会以某种方式导致此错误? 运行时是否需要传入参数 puma ?

无法在Ruby on Rails上安装Puma gem

我正在尝试安装美洲狮gem,但是当我跑的时候 gem install puma 我收到此错误消息: Temporarily enhancing PATH to include DevKit Building native extensions. This could take a while… ERROR: Error installing puma: ERROR: Failed to build gem native extension. C:/Ruby193/bin/ruby.exe extconf.rb creating Makefile make generating puma_http11-i386-mingw32.def compiling http11_parser.c ext/http11/http11_parser.rl: In function ‘puma_parser_execute’: ext/http11/http11_parser.rl:111:3: warning: comparison between signed and unsigned integer expressions compiling io_buffer.c io_buffer.c: […]

puma初始化程序不适用于rails 4.2

我之前已经多次安装过puma并且从未遇到过这个问题。 我按照heroku的说明逐字记录。 我在里面创建了一个Procfile : web: bundle exec puma -C config/puma.rb 这是配置文件puma.rb: workers Integer(ENV[‘WEB_CONCURRENCY’] || 2) threads_count = Integer(ENV[‘MAX_THREADS’] || 5) threads threads_count, threads_count preload_app! rackup DefaultRackup port ENV[‘PORT’] || 3000 environment ENV[‘RACK_ENV’] || ‘development’ on_worker_boot do # Worker specific setup for Rails 4.1+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot ActiveRecord::Base.establish_connection end 当我通过运行rails s或rails s puma启动服务器时,我得到了 => Booting Puma […]

Rails 5同时运行puma和简单的xmlrpc服务器

我的rails应用程序需要一个XMLRPC服务器。 但是当我尝试时: rails s 只有XMLRPC服务器启动而且puma无法启动。 我在config.rb文件中所做的是: require_relative ‘config/environment’ require “xmlrpc/server” server = XMLRPC::Server.new( 1234 ) server.add_handler(‘my_test.test’) { |msg| “responce for #{msg}” } server.serve # HERE IS WHERE APP STUCKS WITH XMLRPC run Rails.application 有没有想法执行此操作?