From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.7 required=5.0 tests=MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Chris Wanstrath Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: Sysadmin Setup question for Unicorn Date: Tue, 3 Nov 2009 09:13:13 -0800 Message-ID: <8b73aaca0911030913g5cdad024obdcf2864f00cd52e@mail.gmail.com> References: <1257250747.10247.135.camel@hbartels-laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1257268408 23893 80.91.229.12 (3 Nov 2009 17:13:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Nov 2009 17:13:28 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Tue Nov 03 18:13:21 2009 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org In-Reply-To: <1257250747.10247.135.camel@hbartels-laptop> X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:123 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1N5Mwa-0002NO-OB for gclrug-mongrel-unicorn@m.gmane.org; Tue, 03 Nov 2009 18:13:20 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 2DBEC1598079; Tue, 3 Nov 2009 12:13:20 -0500 (EST) Received: from mail-pz0-f176.google.com (mail-pz0-f176.google.com [209.85.222.176]) by rubyforge.org (Postfix) with ESMTP id 0446F18582CA for ; Tue, 3 Nov 2009 12:13:17 -0500 (EST) Received: by pzk6 with SMTP id 6so8719030pzk.29 for ; Tue, 03 Nov 2009 09:13:16 -0800 (PST) Received: by 10.114.237.18 with SMTP id k18mr276914wah.63.1257268393940; Tue, 03 Nov 2009 09:13:13 -0800 (PST) On Tue, Nov 3, 2009 at 4:19 AM, huet bartels wrote: > I am trying to setup unicorn to run on ubuntu 8.10. =A0When I try to run > unicorn I am getting the following error. > > with the following command I get the following error. =A0Is this because I > dont have a ruby rails app installed yet? Yes. unicorn_rails must be run from RAILS_ROOT. See http://unicorn.bogomips.org/unicorn_rails_1.html > The other error i get is when I run unicorn with the command line. > > unicorn@install01:/app/unicorn/config$ unicorn -c config.ru > {:daemonize=3D>false, > =A0:unicorn_options=3D> > =A0{:listeners=3D>[], :config_file=3D>"/app/unicorn/config/config.ru"}, > =A0:app=3D> > > #} > I, [2009-11-03T13:03:53.555204 #30820] =A0INFO -- : unlinking existing > socket=3D/app/unicorn/tmp/sockets/unicorn.sock > I, [2009-11-03T13:03:53.555538 #30820] =A0INFO -- : listening on > addr=3D/app/unicorn/tmp/sockets/unicorn.sock fd=3D3 > I, [2009-11-03T13:03:53.555596 #30820] =A0INFO -- : Refreshing Gem list > Exception `NoMethodError' at config.ru:6 - undefined method > `worker_processes' for # > Exception `NoMethodError' > at /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/bin/unicorn= :130 - undefined method `worker_processes' for # > config.ru:6: undefined method `worker_processes' for > # (NoMethodError) > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/buil= der.rb:29:in `instance_eval' > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/buil= der.rb:29:in `initialize' > =A0 =A0 =A0 =A0from config.ru:1:in `new' > =A0 =A0 =A0 =A0from config.ru:1 > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/lib/unico= rn.rb:697:in `eval' > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/bin/unico= rn:130 > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/lib/unico= rn.rb:697:in `call' > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/lib/unico= rn.rb:697:in `build_app!' > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/lib/unico= rn.rb:170:in `start' > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/lib/unico= rn.rb:20:in `run' > > from /app/ruby.1.8.7-p174/lib/ruby/gems/1.8/gems/unicorn-0.93.4/bin/unico= rn:165 > =A0 =A0 =A0 =A0from /app/ruby/bin/unicorn:19:in `load' > =A0 =A0 =A0 =A0from /app/ruby/bin/unicorn:19 > unicorn@install01:/app/unicorn/config$ > > Now is this error generanted because it requires a rails envoiroment. You need a separate unicorn.rb, distinct from your config.ru when using Unicorn. It appears you are using the proper config option (worker_processes) but putting it in the wrong file (config.ru). config.ru defines your app. Unicorn runs your app. The two are interchangeable, and this is a good thing. Trying moving your unicorn specific logic into a unicorn.rb and launching it with `unicorn -c unicorn.rb config.ru` -- = Chris Wanstrath http://github.com/defunkt