unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: mongrel-unicorn@rubyforge.org
Subject: weird unicorn_rails issue...
Date: Wed, 14 Oct 2009 15:15:52 -0700
Message-ID: <20091014221552.GA30624@dcvr.yhbt.net> (raw)

Hi all,

I just had a user on Rails v2.3.2 that had trouble[1] with the
out-of-the-box unicorn_rails, but was worked around by using the
following RAILS_ROOT/config.ru file with plain "unicorn" and
manually setting RAILS_ENV in the shell environment

  require 'config/environment'
  use Rails::Rack::LogTailer
  map("/") do
    use Rails::Rack::Static
    run ActionController::Dispatcher.new

script/server + WEBrick worked out-of-the-box, as well.

Oddly, the same config.ru file does not work with "unicorn_rails",
either (even when the "config.ru" file is explicitly specified);
only with "unicorn".

So I'm a bit perplexed...

[1] - by "trouble", I mean the app became very subtly broken.  Query
parameters (it was a GET request) appeared to be handled correctly, but
the app was not returning the same results.  I looked briefly at the
app and noticed *something* was a bit suspicious:

    -------------- app/controllers/foo_controller.rb -------------
    class FooController < ApplicationController
      def index
        all_params = some_weird_params_generated
        results = BarController.new.action(all_params)
    -------------- app/controllers/bar_controller.rb -------------
    class BarController < ApplicationController
      def action(all_params)

That is, it creates a new controller from within one controller inside
one action.  Note that I'm not 100% certain this responsible for the
breakage we were seeing, but it certainly does look like suspicious
Rails code to me.

I haven't decided if I'll spend time to fix/debug this, but at least
I'll document it here if somebody wants to look into it further.

Eric Wong

             reply	other threads:[~2009-10-14 22:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14 22:15 Eric Wong [this message]
2009-10-16 20:57 ` [PATCH] KNOWN_ISSUES: document Rack gem issue w/Rails 2.3.2 Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091014221552.GA30624@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    --subject='Re: weird unicorn_rails issue...' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhbt.net/unicorn-public
	git clone --mirror http://ou63pmih66umazou.onion/unicorn-public

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 unicorn-public unicorn-public/ https://yhbt.net/unicorn-public \
		unicorn-public@yhbt.net unicorn-public@bogomips.org mongrel-unicorn@rubyforge.org mongrel-unicorn-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
	public-inbox-index unicorn-public

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git