From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.229.49.16 with SMTP id t16cs56568qcf; Wed, 1 Sep 2010 12:14:24 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCLWKvZPsFhCNzPrjBBoEWyoO2w@googlegroups.com designates 10.101.141.14 as permitted sender) client-ip=10.101.141.14; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCLWKvZPsFhCNzPrjBBoEWyoO2w@googlegroups.com designates 10.101.141.14 as permitted sender) smtp.mail=rack-devel+bncCLWKvZPsFhCNzPrjBBoEWyoO2w@googlegroups.com; dkim=pass header.i=rack-devel+bncCLWKvZPsFhCNzPrjBBoEWyoO2w@googlegroups.com Received: from mr.google.com ([10.101.141.14]) by 10.101.141.14 with SMTP id t14mr4108514ann.13.1283368462926 (num_hops = 1); Wed, 01 Sep 2010 12:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:mime-version :received:received:date:x-ip:user-agent:x-http-useragent:message-id :subject:from:to:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=g3+ULEeCIvAd9+RrUBCpb5re79yHzGJZr+DnOPDCbuA=; b=BAMtb+wsaK5+zSRhbJyYQOxWdXoQf/ym3M+h47W8NoFgoWBTE76ah5qtSjZ4i9QsTZ sfOEw1UETNxr+xxyIA7bTu11aA5+lXq80o6N3+eNqQYXe9rR9FVhrniDIgpK8UP1MB4j nIDkppqrQvLFnZQvgGJajQiUtqonzMlUwUHD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:mime-version:date:x-ip:user-agent:x-http-useragent :message-id:subject:from:to:x-original-sender:reply-to:precedence :mailing-list:list-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; b=bqxCJKyylch1C4P4r7C4Sy1/gcNbgRxzXglGyTpYtuOcudqZuWqirAcCI9RjTlCva0 ZLcDmG8Bih8EOdnLEemIs6ymdbGgWlP1Kd3yCpAE2xkqt/AXjVeHW6PP5fP7Rl/hJtq/ gJtFI1C2OFduUumwGUnLJPye+3aoVnDCzD074= Received: by 10.101.141.14 with SMTP id t14mr648401ann.13.1283368461232; Wed, 01 Sep 2010 12:14:21 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.101.146.2 with SMTP id y2ls3004861ann.6.p; Wed, 01 Sep 2010 12:14:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.200.19 with SMTP id x19mr657358anf.9.1283368460129; Wed, 01 Sep 2010 12:14:20 -0700 (PDT) Received: by s9g2000yqd.googlegroups.com with HTTP; Wed, 1 Sep 2010 12:14:20 -0700 (PDT) Date: Wed, 1 Sep 2010 12:14:20 -0700 (PDT) X-IP: 24.12.25.65 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.25 Safari/534.3,gzip(gfe) Message-ID: <0257a5a4-9afb-4abf-bb46-b14fbbc57c38@s9g2000yqd.googlegroups.com> Subject: Bootstrapping rackup with multiple rack gems installed From: Joshua Peek To: Rack Development X-Original-Sender: josh@joshpeek.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=ISO-8859-1 This came up as an issue in Rails 2.3 along with the release of Rack 1.2. Rails 2.3 is locked to Rack 1.0 so if Rack 1.2 is activated before hand, Rails will fail to boot. Most people now have Rack 1.0 and 1.2 both installed. In a prefect rubygems world everything would work fine. (This is why I don't use RG, but a ton of people are still using Rails 2.3 and RG) Starting Rails with `script/server` works fine because Rails boots first. You can start Rails with `rackup` but you have to make sure you are using the matching rack version with `rackup _1.0.1_` which is kind of lame though. The major issue is with servers like unicorn and passenger which have their own bootstrapping scripts. If you boot a Rails 2.3 app with `unicorn` and Rack 1.2 is installed, Unicorn attempts to require rack pulling in the latest version since it doesn't know any better then boots Rails causing the gem conflict. Similar deal with passenger. Unicorn has a valid reason for requiring rack since it needs to load Rack::Builder before it evals the config.ru file. The use of the builder dsl in .ru files causes a serious fundamental problem with loading rack. The application can never specify which version of rack to use since it has to be chosen before its loaded. Possible workarounds: 1) Always bootstrap with the correct version of rackup with `rackup _1.0.0_`, `/path/to/rack/1.0.0/bin/rackup`, etc. 2) Unicorn and Passenger should allow you to specify which rack version to use. 3) Specify a load path or environment file on boot that setups the correct paths or activates the right version of rack. This could be done by requiring an environment that loads Bundler or similar tools. 4) Hacky version independent version of rackup. I hacked this up to demonstration how http://gist.github.com/560926 you can lazily evaluate the builder dsl after the application loads. Are there anymore workarounds? Whats the suggested fix? I'd like to hear some opinions on the whole bootstapping matter.