jjzjj

ruby-on-rails - 为什么我在系统启动的时候启动unicorn会报错?

这是我的unicorn(/etc/init.d/unicorn)初始化脚本:#!/bin/shPATH=/home/josue/.rvm/gems/ruby-1.9.3-p0/bin:/home/josue/.rvm/gems/ruby-1.9.3-p0@global/bin:/home/josue/.rvm/rubies/ruby-1.9.3-p0/bin:/home/josue/.rvm/bin:/usr/local/sbin:$DAEMON=/home/josue/.rvm/gems/ruby-1.9.3-p0/bin/unicorn_railsDAEMON_OPTS="-c/h

ruby - 用 unicorn 产生多个 worker

我正在尝试使用unicorn生成7个工作线程,我的设置如下worker_processes7timeout30preload_apptrue但在日志中,我只看到一名worker产卵。有什么我想念的吗?I,[2014-04-27T01:59:02.190520#47057]INFO--:listeningonaddr=0.0.0.0:9393fd=7I,[2014-04-27T01:59:02.190743#47057]INFO--:worker=0spawning...I,[2014-04-27T01:59:02.191937#47057]INFO--:masterprocessrea

ruby - `<module:Templates>':使用 Sinatra/Unicorn 的未初始化常量 Tilt::CompileSite (NameError)

我是Ruby世界的新手。我使用Sinatra创建了我的第一个应用程序,但在我的生产服务器上遇到了一些问题。当我在我的本地机器上运行unicorn-crandmovie_unicorn.rb时,它工作得很好。但是在生产中,我得到了这个错误:':uninitializedconstantTilt::CompileSite(NameError)在我的randmovie_unicorn.rb文件中:preload_apptrueworking_directory"./"listen8006worker_processes2timeout30我没有使用HAML或任何类似的东西。有人可以帮我吗?谢

ruby-on-rails - Rails 使用 Redis 作为 Unicorn 的 session 存储

我刚刚从使用cookie作为session存储切换到redis。配置如下:#Gemfilegem'redis-rails',group::production#config/initializers/session_store.rbifENV['RAILS_ENV']=='production'Rails.application.config.session_store:redis_store,redis_server:ENV['REDISCLOUD_URL'],expires_in:60.minuteselseRails.application.config.session_stor

ruby-on-rails - 多线程环境下的Redis连接( unicorn )

我已经为这个错误苦苦挣扎了一段时间:Redis::ProtocolError:Got'i'asinitialreplybyte.Ifyou'rerunninginamulti-threadedenvironment,makesureyoupassthe:thread_safeoptionwheninitializingtheconnection.Ifyou'reinaforkingenvironment,suchasUnicorn,youneedtoconnecttoRedisafterforking.它在使用Unicorn和Redis的应用程序中间歇性地发生。从这个redis-rbG

ruby-on-rails - 使用 Redis 和 Unicorn 连接池的好处

背景:我有一个连接到多个Redis数据库的Ruby/Rails+Nginx/Unicorn网络应用程序(即我没有使用Redis.current而是为我的不同连接使用全局变量).我知道当创建一个新的Unicornworker时,我需要在after_forkblock中创建一个新连接,如here所述。和here.我的问题是关于连接池的必要性。根据thisSO线程,“在Unicorn中,每个进程都建立了自己的连接池,所以如果你的数据库池设置为5,并且你有5个Unicornworker,那么你最多可以有25个连接。但是,由于每个unicornworker只能处理一次一个连接,那么除非你的应用程

ruby-on-rails - 如何在 Linux 上使用 Ruby 2.0 改进 unicorn 进程之间的内存共享

Ruby2.0引入了一种写时复制友好的垃圾收集器。我的进程似乎没有保持共享内存超过几分钟-它似乎从shared_dirty到private_dirty很快。其他一些人已经成功地实现了这一点:https://gist.github.com/kenn/5105175http://marianposaceanu.com/articles/on-ruby-2-0-memory-usage-unicorn-and-heroku此程序可用于检查Linux上的内存统计信息:https://gist.github.com/kenn/5105061我的unicorn配置:https://gist.git

ruby-on-rails - Nginx 在连接到 Unicorn 时获得权限被拒绝

我在网上尝试了很多建议,但没有任何效果。我让unicorn和nginx致力于在CentOS6.5服务器上部署ruby​​onrails应用程序。它以前有效,但现在我在尝试拉起该站点时遇到错误的网关错误。我正在使用的两个主要文件是unicorn.rb配置文件和nginx的default.conf文件。这些文件的位置是:/home/myuser/myApp/config/unicorn.rb和/etc/nginx/conf.d/default.conf。以下是它们包含的内容:unicorn.rbSettheworkingapplicationdirectory#working_direct

ruby-on-rails - unicorn 从配置开始失败

Unicorn通过命令成功启动:bundleexecunicorn_rails-Edevelopment并且不适用于config.rbbundleexecunicorn./config/unicorn.rb-EdevelopmentE,[2014-04-22T11:04:49.358626#8207]ERROR--:reaped#worker=0I,[2014-04-22T11:04:49.359031#8207]INFO--:worker=0spawning...I,[2014-04-22T11:04:49.361032#8468]INFO--:worker=0spawnedpid=

ruby-on-rails - 无法在 Windows 上安装 Unicorn

我无法在本地主机(操作系统--Windows8)上安装Unicorn。>geminstallunicornTemporarilyenhancingPATHtoincludeDevKit...Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingunicorn:ERROR:Failedtobuildgemnativeextension.E:/software/Ruby200-x64/bin/ruby.exeextconf.rbcheckingforCLOCK_MONOTONICintime.h...yesc