Hi, everyone. I am in the process of learning Ruby. I''ve concluded that there are couple of quirks with mod_ruby that are limiting me a fair bit, so I''m looking for an alternative. From what I''ve read, Mongrel is The Answer. However, this has left me with a few questions. I''m looking for some help getting a non-rails Mongrel started... I can''t seem to find the docs I need in my web searching... specifically need something that explains what files Mongrel expects to see where for a non-rails app to work. Everything I have found is written on the premise of Mongrel with Rails (eg, http://mongrel.rubyforge.org/rdoc/index.html). ext2:/home/www/ruby/cosmogenesis# mongrel_rails start ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'': no such file to load -- /home/www/ruby/cosmogenesis/config/environment (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:155:in `rails'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:112:in `cloaker_'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `call'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `listener'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:98:in `cloaker_'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `call'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `initialize'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `new'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `run'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in `run'' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 from /usr/bin/mongrel_rails:16:in `load'' from /usr/bin/mongrel_rails:16 ... its pretty obvious that Mongrel is expecting to find some key files with Important Stuff in them, but I can''t seem to find info on where/what. Can someone point me at a how-to or docs that explain what files are needed with what contents? Thanks in advance for any and all help. --Michel
Hey Michel: $ mongrel_rails start is a command specifically for launching rails apps. if you want to use mongrel as the server for your own framework/ application, then take a quick look at the example (examples/ simpletest.rb). http://mongrel.rubyforge.org/rdoc/ using mongrel for your ruby apps is a slightly different approch if your used to cgi-gateways ... but it is infinitely more flexible, since you have Ruby-based control over the whole request/response process.... write yourself a little Handler class to take the request -> call your methods -> modify the response. I think there is a short mongrel book on O''Reily safari online if you have an account. Otherwise, the examples in the source are very helpful .... checkout how the Camping framework uses mongrel (as this is quite simple). I am assuming here that by non-rails...you still meen a Ruby app ... I''ve yet to see anyone launching a PHP app via mongrel :) Regards. Chris Farmiloe Design & Development Oxygen Brighton, BN2 1ED +44 1273 608708 http://www.oxdi.eu On 13 Mar 2007, at 23:36, Michel Vaillancourt wrote:> > Hi, everyone. I am in the process of learning Ruby. I''ve > concluded that there are couple of quirks with mod_ruby that are > limiting me a fair bit, so I''m looking for an alternative. From > what I''ve read, Mongrel is The Answer. However, this has left me > with a few questions. > > I''m looking for some help getting a non-rails Mongrel started... > I can''t seem to find the docs I need in my web searching... > specifically need something that explains what files Mongrel > expects to see where for a non-rails app to work. Everything I > have found is written on the premise of Mongrel with Rails (eg, > http://mongrel.rubyforge.org/rdoc/index.html). > > ext2:/home/www/ruby/cosmogenesis# mongrel_rails start > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'': no such file to load -- /home/www/ruby/ > cosmogenesis/config/environment (LoadError) > from /usr/local/lib/site_ruby/1.8/rubygems/ > custom_require.rb:27:in `require'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > rails.rb:155:in `rails'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/ > mongrel_rails:112:in `cloaker_'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:138:in `call'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:138:in `listener'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/ > mongrel_rails:98:in `cloaker_'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:51:in `call'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > configurator.rb:51:in `initialize'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/ > mongrel_rails:83:in `new'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/ > mongrel_rails:83:in `run'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ > command.rb:211:in `run'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/ > mongrel_rails:243 > from /usr/bin/mongrel_rails:16:in `load'' > from /usr/bin/mongrel_rails:16 > > ... its pretty obvious that Mongrel is expecting to find some key > files with Important Stuff in them, but I can''t seem to find info > on where/what. Can someone point me at a how-to or docs that > explain what files are needed with what contents? > > Thanks in advance for any and all help. > > --Michel > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070314/b951bfe4/attachment-0001.html
Hi, On Mar 14, 2007, at 12:36 AM, Michel Vaillancourt wrote:> I''m looking for some help getting a non-rails Mongrel started... > I can''t seem to find the docs I need in my web searching... > specifically need something that explains what files Mongrel > expects to see where for a non-rails app to work. Everything I > have found is written on the premise of Mongrel with Rails (eg, > http://mongrel.rubyforge.org/rdoc/index.html). > > ext2:/home/www/ruby/cosmogenesis# mongrel_rails start > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'': no such file to load -- /home/www/ruby/ > cosmogenesis/config/environment (LoadError)Looks like you _are_ trying to use the rails handler for your non- rails app. Your first step is to make your own mongrel handler for your app. Looking at the handlers in the mongrel source (and mongrel in general; reading the source is the easiest way to understand how it works), and other frameworks like rails, merb, camping & nitro is a good start. I''d also suggest looking into rack (http://rack.rubyforge.org/) for handling all those boring details. JS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070314/76769e89/attachment.html
You probably don''t want to use ''mongrel_rails'' if you don''t want to use rails. Instead, you should probably write some handlers and write a configurator script that brings them all together. The docs on both are located at http://mongrel.rubyforge.org/rdoc/index.html. An example is included with mongrel: /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/examples/simpletest.rb On 3/14/07, Michel Vaillancourt <michel at wolfstar.ca> wrote:> > Hi, everyone. I am in the process of learning Ruby. I''ve concluded that there are couple of quirks with mod_ruby that are limiting me a fair bit, so I''m looking for an alternative. From what I''ve read, Mongrel is The Answer. However, this has left me with a few questions. > > I''m looking for some help getting a non-rails Mongrel started... I can''t seem to find the docs I need in my web searching... specifically need something that explains what files Mongrel expects to see where for a non-rails app to work. Everything I have found is written on the premise of Mongrel with Rails (eg, http://mongrel.rubyforge.org/rdoc/index.html). > > ext2:/home/www/ruby/cosmogenesis# mongrel_rails start > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'': no such file to load -- /home/www/ruby/cosmogenesis/config/environment (LoadError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:155:in `rails'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:112:in `cloaker_'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `call'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `listener'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:98:in `cloaker_'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `call'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `initialize'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `new'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `run'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in `run'' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 > from /usr/bin/mongrel_rails:16:in `load'' > from /usr/bin/mongrel_rails:16 > > ... its pretty obvious that Mongrel is expecting to find some key files with Important Stuff in them, but I can''t seem to find info on where/what. Can someone point me at a how-to or docs that explain what files are needed with what contents? > > Thanks in advance for any and all help. > > --Michel > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
Thanks to everyone for your suggestions. I''ll go do some more reading. :) --Michel
On 3/14/07, Michel R Vaillancourt <michel at wolfstar.ca> wrote:> > Thanks to everyone for your suggestions. I''ll go do some more reading. :)If you want a thin, easy layer on Mongrel for writing an app, take a look at Rack. rack.rubyforge.org Kirk Haines