rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Bootstrapping rackup with multiple rack gems installed
@ 2010-09-01 19:14 Joshua Peek
  2010-09-01 19:16 ` Steve Klabnik
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Joshua Peek @ 2010-09-01 19:14 UTC (permalink / raw)
  To: Rack Development

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-09-02 12:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01 19:14 Bootstrapping rackup with multiple rack gems installed Joshua Peek
2010-09-01 19:16 ` Steve Klabnik
2010-09-01 19:20   ` Konstantin Haase
2010-09-01 19:21     ` Steve Klabnik
2010-09-01 19:25       ` Yehuda Katz
2010-09-01 19:49         ` Konstantin Haase
2010-09-01 23:55           ` Lawrence Pit
2010-09-02  0:14             ` Randy Fischer
2010-09-01 19:23   ` Joshua Peek
2010-09-01 19:25     ` Steve Klabnik
2010-09-02  4:14 ` Eric Wong
2010-09-02 12:01 ` James Tucker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).