From tmp008 at allproducts.info Mon Apr 12 00:59:35 2010 From: tmp008 at allproducts.info (Anton Trapp) Date: Mon, 12 Apr 2010 06:59:35 +0200 Subject: [Mongrel] No file uploads possible with mongrel? Message-ID: <2BF6584C-E227-484F-AB1C-90970192C130@allproducts.info> Hello all! I am using mongrel in several production environments and it is working great! Now I have to put up some really large files (html multipart, no plugin used, some hundret Mb). The only thing I can produce with mongrel is: Sun Apr 11 06:13:21 +0000 2010: Error reading HTTP body: # /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:107:in `read_socket' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:86:in `read_body' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:55:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 /usr/bin/mongrel_rails:19:in `load' /usr/bin/mongrel_rails:19 Any ideas? alternatives? Thank you VERY much in advance! Regards, Anton From luislavena at gmail.com Mon Apr 12 09:34:06 2010 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 12 Apr 2010 10:34:06 -0300 Subject: [Mongrel] No file uploads possible with mongrel? In-Reply-To: <2BF6584C-E227-484F-AB1C-90970192C130@allproducts.info> References: <2BF6584C-E227-484F-AB1C-90970192C130@allproducts.info> Message-ID: On Mon, Apr 12, 2010 at 1:59 AM, Anton Trapp wrote: > Hello all! > > I am using mongrel in several production environments and it is working great! Now I have to put up some really large files (html multipart, no plugin used, some hundret Mb). The only thing I can produce with mongrel is: > > Sun Apr 11 06:13:21 +0000 2010: Error reading HTTP body: # > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:107:in `read_socket' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:86:in `read_body' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_request.rb:55:in `initialize' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `new' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:149:in `process_client' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 > /usr/bin/mongrel_rails:19:in `load' > /usr/bin/mongrel_rails:19 > > Any ideas? alternatives? > If you're mentioning hundred of megabytes it might be possible that the Ruby instance is not able to handle the file properly. Would be great if you can isolate this to a real minimum mongrel handler example instead of a Rails application. I had successfully uploaded big files with mongrel, but honestly never tried to upload 200mb or similar because will be suboptimal. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From lists at ruby-forum.com Tue Apr 13 15:27:13 2010 From: lists at ruby-forum.com (Jason Fawcett) Date: Tue, 13 Apr 2010 21:27:13 +0200 Subject: [Mongrel] Problem getting Mongrel to work with RadRails Message-ID: Hi all, I'm very new to Ruby, and I'm trying to learn Ruby on Rails. I got a book on the subject, and I've installed everything according to the directions, but I can't get the Mongrel server to work. I'm using the RadRails plugin with Aptana Studio, I've started a new project, and everything seems to be setup fine, but whenever I try to start the server, I get the following: C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require': 126: The specified module could not be found. - C:/Ruby19/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mingw32/lib/http11.so (LoadError) from C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:12:in `' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:1:in `' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `const_get' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `block in get' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `each' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `get' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.4/lib/commands/server.rb:45:in `' from C:/Users/Jason/My Documents/Aptana Studio Workspace/company/script/server:3:in `require' from C:/Users/Jason/My Documents/Aptana Studio Workspace/company/script/server:3:in `' from -e:2:in `load' from -e:2:in `
' I checked to make sure the file (http11.so) is located in the directory listed above, and it is. I've also tried upgrading rails to 2.3.5, and I've tried re-installing mongrel with 'gem install mongrel', but I'm still getting the exact same error. I've googled this problem, and it seems a lot of people have run up against it, but I couldn't find any responses beyond 'switch to thin or passenger', which I'm not exactly sure how to do. Anyhow, any assistance you could render would be greatly appreciated. -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Apr 13 15:48:57 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 13 Apr 2010 16:48:57 -0300 Subject: [Mongrel] Problem getting Mongrel to work with RadRails In-Reply-To: References: Message-ID: On Tue, Apr 13, 2010 at 4:27 PM, Jason Fawcett wrote: > Hi all, > > ?I'm very new to Ruby, and I'm trying to learn Ruby on Rails. ?I got a > book on the subject, and I've installed everything according to the > directions, but I can't get the Mongrel server to work. ?I'm using the > RadRails plugin with Aptana Studio, I've started a new project, and > everything seems to be setup fine, but whenever I try to start the > server, I get the following: > > C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in > `require': 126: The specified module could not be found. ? - > C:/Ruby19/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mingw32/lib/http11.so > (LoadError) > ?from > C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in > `block in require' > ?from The gem you have installed has been compiled for Ruby 1.8, not Ruby 1.9 You need a gem that is compatible with Ruby 1.9 At this time, I would recommend you install the pre-release version of the gem: gem install mongrel --pre Which includes binaries for 1.9 HTH, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From pete at kapiti.co.nz Tue Apr 13 16:34:37 2010 From: pete at kapiti.co.nz (Pete) Date: Wed, 14 Apr 2010 08:34:37 +1200 Subject: [Mongrel] Mongrel script and config options In-Reply-To: References: Message-ID: <9F2350A441F841DD9AB205AD29637C05@Gavdos> I need to pass some startup options on to my rails application. Using environment variables will not work because multiple mongrel clusters of my rails application (each of a slightly different flavour) served from a single code base can run concurrently and each cluster instance is activated via mongrel_service. Extra arguments passed in to either mongrel_rails service::install or mongrel_rails cause errors. The only documentation on the --script option I could find related to unix so I gave up on that thought. I also tried using the --config option, but I had the same problem there: as soon as I added an option to the YAML file that wasn't documented, mongrel complained with an error. The last one is a real nuisance. It just doesn't make sense that my config file should be restricted to content mongrel understands. Wouldn't it be a better approach to parse that file and look/apply the options mongrel recognises and provide a public interface so that other interested clients can access the config file? Or are there other ways to achieve this without resorting to modifying mongrel and mongrel services startup code? Pete From luislavena at gmail.com Tue Apr 13 17:38:36 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 13 Apr 2010 18:38:36 -0300 Subject: [Mongrel] Mongrel script and config options In-Reply-To: <9F2350A441F841DD9AB205AD29637C05@Gavdos> References: <9F2350A441F841DD9AB205AD29637C05@Gavdos> Message-ID: On Tue, Apr 13, 2010 at 5:34 PM, Pete wrote: > I need to pass some startup options on to my rails application. Using > environment variables will not work because multiple mongrel clusters of my > rails application (each of a slightly different flavour) served from a > single code base can run concurrently and each cluster instance is activated > via mongrel_service. > > Extra arguments passed in to either mongrel_rails service::install or > mongrel_rails cause errors. > I think you've already reported this to me here: http://github.com/fauna/mongrel_service/issues#issue/4 And if wasn't you, pretty much is similar request. > The only documentation on the --script option I could find related to unix > so I gave up on that thought. > Script takes any Ruby script and execute it before starting mongrel, and is honored by mongrel_service > I also tried using the --config option, but I had the same problem there: as > soon as I added an option to the YAML file that wasn't documented, mongrel > complained with an error. > mongrel_rails start --help: -C, --config PATH Use a config file -S, --script PATH Load the given file as an extra config script -G, --generate PATH Generate a config file for use with -C mongrel_rails start -G foo.yml ** Writing config to "C:/Users/Luis/projects/secret/foo.yml". ** Finished. Run "mongrel_rails start -C C:/Users/Luis/projects/secret/foo.yml" to use the config file. > The last one is a real nuisance. It just doesn't make sense that my config > file should be restricted to content mongrel understands. Wouldn't it be a > better approach to parse that file and look/apply the options mongrel > recognises and provide a public interface so that other interested clients > can access the config file? > Sorry, but is the configuration file *for* mongrel, nobody says to you that you should use it. The problem is that you're trying to use the same application, the same checkout of it and everything to run multiple instances that are different on configuration settings. Apologizes for this but that is wrong. Even sharing database.yml could lead to problems. > Or are there other ways to achieve this without resorting to modifying > mongrel and mongrel services startup code? > Do checkouts of your application on different directories. Have per-location configuration settings like config/settings.yml that is not part of your application source code. Is kind of complicated expect the same application folder serve multiple versions of the same application. Perhaps if you would explain better what are those settings we can advise you on different approaches. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From pete at kapiti.co.nz Tue Apr 13 18:25:36 2010 From: pete at kapiti.co.nz (Pete) Date: Wed, 14 Apr 2010 10:25:36 +1200 Subject: [Mongrel] Mongrel script and config options In-Reply-To: <9F2350A441F841DD9AB205AD29637C05@Gavdos> References: <9F2350A441F841DD9AB205AD29637C05@Gavdos> Message-ID: <3535652645D14EB487B30883453B041B@Gavdos> Interesting is also this page http://guides.rails.info/configuring.html which states under "2.Running Code Before Rails": To run some code before Rails itself is loaded, simply put it above the call to require 'rails/all' in your application.rb. If I log boot strapping of rails, I get this different sequences: when using mongrel via script/server (notice boot.rb appears twice!!!): boot.rb environment.rb boot.rb application.rb when using mongrel via mongrel_rails: environment.rb boot.rb application.rb Note that while the latter option is the common way to start the application, the former option is what I must use to debug my rails application under Netbeans. So clearly, running code (that fetches custom specific command line options) before rails starts doesn't work well with either environment, let alone both. I've even tried to place such code inside environment.rb which is clearly loaded before application.rb and still had no luck. So far, the only way that worked for me is to modify library code and this is something a dread. Pete -----Original Message----- From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Pete Sent: Wednesday, 14 April 2010 8:35 a.m. To: mongrel-users at rubyforge.org Subject: [Mongrel] Mongrel script and config options I need to pass some startup options on to my rails application. Using environment variables will not work because multiple mongrel clusters of my rails application (each of a slightly different flavour) served from a single code base can run concurrently and each cluster instance is activated via mongrel_service. Extra arguments passed in to either mongrel_rails service::install or mongrel_rails cause errors. The only documentation on the --script option I could find related to unix so I gave up on that thought. I also tried using the --config option, but I had the same problem there: as soon as I added an option to the YAML file that wasn't documented, mongrel complained with an error. The last one is a real nuisance. It just doesn't make sense that my config file should be restricted to content mongrel understands. Wouldn't it be a better approach to parse that file and look/apply the options mongrel recognises and provide a public interface so that other interested clients can access the config file? Or are there other ways to achieve this without resorting to modifying mongrel and mongrel services startup code? Pete _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From luislavena at gmail.com Tue Apr 13 18:35:29 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 13 Apr 2010 19:35:29 -0300 Subject: [Mongrel] Mongrel script and config options In-Reply-To: <3535652645D14EB487B30883453B041B@Gavdos> References: <9F2350A441F841DD9AB205AD29637C05@Gavdos> <3535652645D14EB487B30883453B041B@Gavdos> Message-ID: On Tue, Apr 13, 2010 at 7:25 PM, Pete wrote: > Interesting is also this page http://guides.rails.info/configuring.html > which states under "2.Running Code Before Rails": To run some code before > Rails itself is loaded, simply put it above the call to require 'rails/all' > in your application.rb. > > If I log boot strapping of rails, I get this different sequences: > > when using mongrel via script/server (notice boot.rb appears twice!!!): > ?boot.rb > ?environment.rb > ?boot.rb > ?application.rb > > when using mongrel via mongrel_rails: > ?environment.rb > ?boot.rb > ?application.rb > > Note that while the latter option is the common way to start the > application, the former option is what I must use to debug my rails > application under Netbeans. > I would avoid script/server as it loads mongrel incorrectly. > So clearly, running code (that fetches custom specific command line options) > before rails starts doesn't work well with either environment, let alone > both. > Can I know how are you doing it? > I've even tried to place such code inside environment.rb which is clearly > loaded before application.rb and still had no luck. > Which part? the top? the bottom? Which version of rails? If you place the code in config/preinitializer.rb it will be loaded before environment.rb fully loads. > So far, the only way that worked for me is to modify library code and this > is something a dread. > Please be more specific with the examples. Show us code so we can replicate and workout solutions. You can't supply command line options to mongrel_rails that are not supported, however, you can use either environment variables or other stuff. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From pete at kapiti.co.nz Tue Apr 13 19:39:46 2010 From: pete at kapiti.co.nz (Pete) Date: Wed, 14 Apr 2010 11:39:46 +1200 Subject: [Mongrel] Mongrel script and config options In-Reply-To: References: <9F2350A441F841DD9AB205AD29637C05@Gavdos><3535652645D14EB487B30883453B041B@Gavdos> Message-ID: <4B1DB8D231B84609BBEACE536F07993F@Gavdos> Hi Luis, Thanks for your reply. You're right, it was me who ask the same question in github, but since it was more related to mongrel_service and my issue has to do with rails boot strapping it didn't seem the right place. First up, I'm still using Rails 2.2.2. I'm sorry, but I don't agree with you that a single code base for multiple different rails application is a bad idea, quite the opposite actually. If you're really interested in what we're doing, this thread explains it in more detail: http://railsforum.com/viewtopic.php?pid=74217. It shouldn't be too hard to see the many advantages of a single code base over multiple code bases for serving multiple clients similar applications. As I said, I played with the --script option but couldn't get it to work. Here is how I start mongrel from the command line for client FOO: mongrel_rails start -e production -p 3035 -l "log/FOO/mongrel.log" -S "config/FOO/myapp_opts.rb" -c "x:/myapp" But config/FOO/myapp_opts.rb is never loaded (I've also tried specifying the full path "x:/myapp/config/FOO/myapp_opts.rb" to no avail). If this worked, it would solve my problem. So what am I doing wrong? Pete > -----Original Message----- > From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users- > bounces at rubyforge.org] On Behalf Of Luis Lavena > Sent: Wednesday, 14 April 2010 10:35 a.m. > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Mongrel script and config options > > On Tue, Apr 13, 2010 at 7:25 PM, Pete wrote: > > Interesting is also this page http://guides.rails.info/configuring.html > > which states under "2.Running Code Before Rails": To run some code > before > > Rails itself is loaded, simply put it above the call to require > 'rails/all' > > in your application.rb. > > > > If I log boot strapping of rails, I get this different sequences: > > > > when using mongrel via script/server (notice boot.rb appears twice!!!): > > ?boot.rb > > ?environment.rb > > ?boot.rb > > ?application.rb > > > > when using mongrel via mongrel_rails: > > ?environment.rb > > ?boot.rb > > ?application.rb > > > > Note that while the latter option is the common way to start the > > application, the former option is what I must use to debug my rails > > application under Netbeans. > > > > I would avoid script/server as it loads mongrel incorrectly. > > > So clearly, running code (that fetches custom specific command line > options) > > before rails starts doesn't work well with either environment, let alone > > both. > > > > Can I know how are you doing it? > > > I've even tried to place such code inside environment.rb which is > clearly > > loaded before application.rb and still had no luck. > > > > Which part? the top? the bottom? Which version of rails? > > If you place the code in config/preinitializer.rb it will be loaded > before environment.rb fully loads. > > > So far, the only way that worked for me is to modify library code and > this > > is something a dread. > > > > Please be more specific with the examples. Show us code so we can > replicate and workout solutions. > > You can't supply command line options to mongrel_rails that are not > supported, however, you can use either environment variables or other > stuff. > > -- > Luis Lavena > AREA 17 > - > Perfection in design is achieved not when there is nothing more to add, > but rather when there is nothing more to take away. > Antoine de Saint-Exup?ry > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From luislavena at gmail.com Tue Apr 13 20:22:22 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 13 Apr 2010 21:22:22 -0300 Subject: [Mongrel] Mongrel script and config options In-Reply-To: <4B1DB8D231B84609BBEACE536F07993F@Gavdos> References: <9F2350A441F841DD9AB205AD29637C05@Gavdos> <3535652645D14EB487B30883453B041B@Gavdos> <4B1DB8D231B84609BBEACE536F07993F@Gavdos> Message-ID: On Tue, Apr 13, 2010 at 8:39 PM, Pete wrote: > Hi Luis, > > First up, I'm still using Rails 2.2.2. > > I'm sorry, but I don't agree with you that a single code base for multiple > different rails application is a bad idea, quite the opposite actually. If > you're really interested in what we're doing, this thread explains it in > more detail: http://railsforum.com/viewtopic.php?pid=74217. > You're preaching to the wrong choir. I was the one that originated the approach of Radiant to build applications, and make gems of Rails applications with custom settings, database and configuration files. It was called fossilize, but due the constant internal changes of Rails was hard to keep it up. Since now is based on Rack (Rails 3), it might be easy to resurrect the idea. > It shouldn't be too hard to see the many advantages of a single code base > over multiple code bases for serving multiple clients similar applications. > Is not that is hard to see, is hard to wrap Rails around that concept Reading your post what you actually need is more in the lines of Radiant approach: * make your application a gem * use a single directory for each individual application, but still depend on the same gem * extend or change the application with extensions from vendor, that might be different from client A to client B > As I said, I played with the --script option but couldn't get it to work. > Here is how I start mongrel from the command line for client FOO: > > mongrel_rails start -e production -p 3035 -l "log/FOO/mongrel.log" -S > "config/FOO/myapp_opts.rb" -c "x:/myapp" > > But config/FOO/myapp_opts.rb is never loaded (I've also tried specifying the > full path "x:/myapp/config/FOO/myapp_opts.rb" to no avail). If this worked, > it would solve my problem. So what am I doing wrong? According to this: http://github.com/fauna/mongrel/blob/master/bin/mongrel_rails#L122-125 And this: http://github.com/fauna/mongrel/blob/master/lib/mongrel/configurator.rb#L342-348 The purpose of the config script is internal of Mongrel, not to setup stuff globally for the application like Rails. ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Loading config/init_mongrel.rb external config script Also, it happens "after" Rails initialization. I would suggest you try the following: 1) put your init script code inside config/preinitializer.rb It gets executed by boot before Rails::Initializer.run of environment.rb. example: >type config\preinitializer.rb STDERR.puts ARGV.inspect 2) Use something like MYAPP_TARGET=foo in the command line: mongrel_rails start MYAPP_TARGET=foo Will get you something like this: ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ["MYAPP_TARGET =foo"] ["MYAPP_TARGET =foo"] ** Rails loaded. ** Loading any Rails specific GemPlugins (dunno why appears twice, is like the file gets "loaded" instead of required) 3) Add the additional parameter to created mongrel_service manually (registry editing) At this time, there is no way to specify additional parameters. I would like to move the configuration from command line to the registry, so is more easy to manipulate. That helps somehow? Thank you for explaining in further detail your need, it helped me provide you a better alternative. Of course, there is still room for improvement, and patches are always welcomed ;-) -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From pete at kapiti.co.nz Tue Apr 13 21:49:54 2010 From: pete at kapiti.co.nz (Pete) Date: Wed, 14 Apr 2010 13:49:54 +1200 Subject: [Mongrel] Mongrel script and config options In-Reply-To: References: <9F2350A441F841DD9AB205AD29637C05@Gavdos><3535652645D14EB487B30883453B041B@Gavdos> <4B1DB8D231B84609BBEACE536F07993F@Gavdos> Message-ID: Hi Luis, > You're preaching to the wrong choir. I'm glad ;) > 2) Use something like MYAPP_TARGET=foo in the command line: > > mongrel_rails start MYAPP_TARGET=foo > > Will get you something like this: > > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > ["MYAPP_TARGET =foo"] > ["MYAPP_TARGET =foo"] > ** Rails loaded. > ** Loading any Rails specific GemPlugins > > (dunno why appears twice, is like the file gets "loaded" instead of > required) ************** *** WOW!!! *** ************** I had no idea that would work. What are these things called? They're not really options, are they? Just tried it out and not only can I trap these options easily using preinitialize.rb with mongrel_service as well as mongrel_rails, but it also works perfectly fine in script/server (sorry, I know you don't like this and I trust your judgement, but it is the only option I have when debugging under Netbeans). THIS SOLVES MY PROBLEM! I missed this feature completely or it is undocumented. Had I known that a couple of weeks back I could have spent a week at the beach and would still be further than I am now. > 3) Add the additional parameter to created mongrel_service manually > (registry editing) For me that isn't a big deal since we have an installer and can easily configure the mongrel services during installation by writing to the registry directly. > Thank you for explaining in further detail your need, it helped me > provide you a better alternative. Of course, there is still room for > improvement, and patches are always welcomed ;-) NO THANK YOU FOR YOUR HELP! Now I've also noticed that mongrel_rails service::install doesn't complain at all if I specify such glyphs (like MYAPP_TARGET=foo). However, they are not added to the ImagePath. If you think this would be useful, I see if I can fix it and submit a patch? Many thanks again, its hugely appreciated. From luislavena at gmail.com Tue Apr 13 22:04:51 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 13 Apr 2010 23:04:51 -0300 Subject: [Mongrel] Mongrel script and config options In-Reply-To: References: <9F2350A441F841DD9AB205AD29637C05@Gavdos> <3535652645D14EB487B30883453B041B@Gavdos> <4B1DB8D231B84609BBEACE536F07993F@Gavdos> Message-ID: On Tue, Apr 13, 2010 at 10:49 PM, Pete wrote: > >> 2) Use something like MYAPP_TARGET=foo in the command line: >> >> mongrel_rails start MYAPP_TARGET=foo >> >> Will get you something like this: >> >> ** Starting Mongrel listening at 0.0.0.0:3000 >> ** Starting Rails with development environment... >> ["MYAPP_TARGET =foo"] >> ["MYAPP_TARGET =foo"] >> ** Rails loaded. >> ** Loading any Rails specific GemPlugins >> >> (dunno why appears twice, is like the file gets "loaded" instead of >> required) > > ************** > *** WOW!!! *** > ************** > > I had no idea that would work. What are these things called? They're not > really options, are they? > They are coming from ARGV, are not parsed by OptionParse (used by mongrel), so are just ignored and left available in ARGV. > Just tried it out and not only can I trap these options easily using > preinitialize.rb with mongrel_service as well as mongrel_rails, but it also > works perfectly fine in script/server (sorry, I know you don't like this and > I trust your judgement, but it is the only option I have when debugging > under Netbeans). > Hehe, well, if works for you for debugging will not say anything :) > THIS SOLVES MY PROBLEM! > Glad to hear that. > I missed this feature completely or it is undocumented. Had I known that a > couple of weeks back I could have spent a week at the beach and would still > be further than I am now. > config/preinitializer.rb is a hidden feature that actually nobody knows of it. It started to be more noticeable with the appearance of Bundler. Apologizes for you spending your time doing this, the mailing list should have been more exposed :( > > Now I've also noticed that mongrel_rails service::install doesn't complain > at all if I specify such glyphs (like MYAPP_TARGET=foo). However, they are > not added to the ImagePath. If you think this would be useful, I see if I > can fix it and submit a patch? > These options are not carried over. A minor patch that takes the left overs of ARGV and append to the registry line could work. Add the gist link with the diff to the mongrel_service GitHub issue, I'll get that integrated ;-) > Many thanks again, its hugely appreciated. > You're welcome :) Regards, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From pete at kapiti.co.nz Wed Apr 14 01:48:09 2010 From: pete at kapiti.co.nz (Pete) Date: Wed, 14 Apr 2010 17:48:09 +1200 Subject: [Mongrel] Mongrel script and config options In-Reply-To: References: <9F2350A441F841DD9AB205AD29637C05@Gavdos><3535652645D14EB487B30883453B041B@Gavdos> <4B1DB8D231B84609BBEACE536F07993F@Gavdos> Message-ID: <174A647F65E8439B9229F80B40132681@Gavdos> > > If I can fix it and submit a patch... > > Add the gist link with the diff to the mongrel_service GitHub issue, > I'll get that integrated ;-) I wish I knew anything about gist, but I made a simple change to mongrel_service-0.4.beta3\lib\mongrel_service\init.rb which I explained here: http://github.com/fauna/mongrel_service/issues/#issue/4 The modified file is enclosed. Cheers and thanks heaps Pete -------------- next part -------------- A non-text attachment was scrubbed... Name: init.rb Type: application/octet-stream Size: 7997 bytes Desc: not available URL: From luislavena at gmail.com Mon Apr 19 10:42:02 2010 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 19 Apr 2010 11:42:02 -0300 Subject: [Mongrel] Problem with mongrel_rails, but works with script/server In-Reply-To: <9E8D04449E8A4B918BBAFF2A0C6CB05C@mistral> References: <9E8D04449E8A4B918BBAFF2A0C6CB05C@mistral> Message-ID: On Mon, Apr 19, 2010 at 9:21 AM, wrote: > Hi there, I am having problem with mongrel_rails and > I do not know whom to ask so I found your e-mail as > one of the last people contributing to mongrel_rails, so > may be you would be able to help me out. > Please, email mongrel-users mailing list for problems, so in that way all benefit from the answers. http://rubyforge.org/mailman/listinfo/mongrel-users > Here is the problem: > My platform is XP, ruby 1.8.6, rails 2.3.2. mongrel-1.1.5-x86-mswin32-60, > mongrel_service-0.3.4-x86-mswin32. > > I have my application working perfectly when I start it with > "script/server", but > when ?I "use mongrel_rails start" it starts the app but on several > controllers it breaks (not all of them though <-how come???) and when it > braks ti shows the > message "undefined method `reflect_on_association' for Service:Module" > Do you have a model called Service? mongrel_service it also contains a module called Service, so maybe ActiveRecord might be clashing, which is strange. Please provide a backtrace of the error, not just the last line of the error. > When I set the break point in,the action of the controller where it breaks, > and > when the processing stop on this break point and if I type > ?>params > It says >>"Unknown command: "params". Try "help" > but If I type >>eval params > it shows me the correct content of params hash: >> {"action"=>"index", "controller"=>"doctor"}. > > Also if I type >>@_params > it says >>"Unknown commad" "@_params". Try "help" > but if I type >>eval @_params > it responds properly >> {"action"=>"index", "controller"=>"doctor"} > > It even do not understands. If you're using ruby-debug, you need to eval to get information from the process you're debugging, you can't call params directly. > Please help me if you can or may be direct me to somewhere where I could > find help, advise or answers. > Please provide a full backtrace, you might be using a served word for a controller or model that could be clashing with Mongrel, Rails or mongrel_service. Also, join and respond to mongrel-users mailing list, so all benefit from the findings. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From luislavena at gmail.com Mon Apr 19 13:21:18 2010 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 19 Apr 2010 14:21:18 -0300 Subject: [Mongrel] Problem with mongrel_rails, but works with script/server In-Reply-To: <189F2C865B624D18B795D1FAA061AFBA@mistral> References: <189F2C865B624D18B795D1FAA061AFBA@mistral> Message-ID: On Mon, Apr 19, 2010 at 2:07 PM, wrote: > Hi Luis, thank you very much for the answer. Using eval (per your > suggestion:)) I was > able to start debugging the problem. > The error shows up when executing the following statement: > @customers=provider.customers > > Here is the full error log that > gets shown on the browser: > ------>>>>>--------- > > undefined method `reflect_on_association' for Service:Module > > RAILS_ROOT: C:/RubyOnRails/rails_apps/msms > Application Trace | Framework Trace | Full Trace > > C:/RubyOnRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_rec > ord/reflection.rb:257:in `source_reflection' > C:/RubyOnRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_rec > ord/reflection.rb:257:in `collect' > C:/RubyOnRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_rec > ord/reflection.rb:257:in `source_reflection' > C:/RubyOnRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_rec > ord/reflection.rb:288:in `check_validity!' > C:/RubyOnRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_rec > ord/associations/has_many_through_association.rb:5:in `initialize' > C:/RubyOnRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_rec > ord/associations.rb:1277:in `new' > C:/RubyOnRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_rec > ord/associations.rb:1277:in `customers' > C:/RubyOnRails/rails_apps/msms/app/controllers/doctor_controller.rb:17:in > `index' > ---------<<<<<<<<<----- > > I have the following relatonships relating to this problem in my models: > > class Provider < ActiveRecord::Base > ? ? ? ?has_many :services > ? ? ? ?has_many :customers, :through => :services > ? ? ?...... > ? ? ? ?..... > end > > class Service < ActiveRecord::Base > ? ? ? ?belongs_to :provider > ? ? ? ?belongs_to :customer > ? ? ? ?belongs_to :invoice > ? ? ?...... > ? ? ? ?..... > end > > class Customer < ActiveRecord::Base > ? ? ? ?has_many :services > ? ? ? ?has_many :providers, :through => :services > ? ? ? ?has_many :invoices, :dependent=> :destroy > ? ? ?...... > ? ? ? ?..... > end > > class Invoice < ActiveRecord::Base > ? ? ? ?has_many :services > ? ? ? ?belongs_to :customer > ? ? ?...... > ? ? ? ?..... > end > > What is puzzling is that if I use "script/server" (which starts the mongrel) > all works fine, > but if I use "mongrel_rails start" this error shows up. What is diffenrent > under the hub between > these two? script/server initializes Rails before Mongrel, while mongrel_rails does the opposite. Since you've installed mongrel_service gem, it defines a Service module, which is used as plugin to install inside mongrel how command functionality: http://github.com/fauna/mongrel_service/blob/master/lib/mongrel_service/init.rb#L8-9 If you aren't using mongrel_service, I would suggest you remove the gem. The problem is that the plugin for mongrel can't be named differently. If we do, then will break compatibility with old versions. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From lists at ruby-forum.com Fri Apr 23 01:47:35 2010 From: lists at ruby-forum.com (T_ S_) Date: Fri, 23 Apr 2010 07:47:35 +0200 Subject: [Mongrel] Mongrel_rails can't find memcache-client In-Reply-To: <71166b3b1003240250t658165edle295347ef9bbafad@mail.gmail.com> References: <2b83b50d03577012d5a21238a6b526fe@ruby-forum.com> <71166b3b1003240250t658165edle295347ef9bbafad@mail.gmail.com> Message-ID: <86f9670ef86039cb391f830997081bcc@ruby-forum.com> I switched from gem "memcache-client" to gem "memcache" and it works without any problems. Both gems are installed in the same way etc. Unfortunately rails when set to use memcache as a session store references to the "memcache-client" so that needs to be included also and I'm back with the original error message. Funny things is of course that it's not really using that "memcache-client" gem as in an initializer i say CACHE = Memcache.new(:server => "localhost:11211", :namespace => 'web', :segment_large_values => true) And in session_store.rb ActionController::Base.session = { :key => '_xxxxx', :secret => 'xxxxxxx', :cache => CACHE, :expires => 15.minutes } So the end result is that when I start mongrel with "mongrel_rails start" it complains that "no such file to load -- memcache-client" but the server keeps running and app works as that gem is not really used. > When you start mongrel_rails, you're doing without daemonize, correct? Yep. > There is no configuration file that indicates mongrel should change > user or group when running, correct? Yep. > It might be that the memcache-client gem is not installed system wide. In my local env I'm using rvm to handle different ruby envs. So the gems are installed to specific ruby env under my home dir, not system wide. But i did try this with system wide installation also and it didn't help. > Can you build an exact pastie/gist of the output you're receiving? (or > can replicate with a simple rails app?) Here's the output: http://pastie.org/931033 -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Apr 27 23:40:52 2010 From: lists at ruby-forum.com (Robb Lovell) Date: Wed, 28 Apr 2010 05:40:52 +0200 Subject: [Mongrel] Raw Post error going into mongrel:Error reading HTTP body: # Message-ID: <0b18353f91b247d20a8d6c497a2cd6ec@ruby-forum.com> I am writing to an API that returns data in a callback as a raw POST request. On it's way into my rails controller, mongrel can't read the body of the request. A PHP routine inside Apache has no problem with the request (which is Content-Type: Application/octet-stream). I can read it in PHP like so: $response = file_get_contents('php://input'); But in ROR's Mongrel server it never makes it to the ROR controller and this happens: Tue Apr 27 20:21:32 -0700 2010: Error reading HTTP body: # /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/http_request.rb:105:in `read_socket' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/http_request.rb:77:in `read_body' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/http_request.rb:55:in `initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:149:in `new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:149:in `process_client' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run' /Users/lovell/Code/workspaces/Vidigami/vidigami/vendor/rails/railties/lib/commands/server.rb:111 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' ./script/server:3 /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb:109:in `debug_load' /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb:109:in `debug_program' /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.9/bin/rdebug-ide:87 /usr/bin/rdebug-ide:19:in `load' /usr/bin/rdebug-ide:19 Mongrel can't find the rest of the stream or has read past the end of the stream prematurely. My "work around" is to have PHP page forward the request like so: $response = file_get_contents('php://input'); $Curl_Session = curl_init("http://24.84.32.19:3000/facer/detect_result"); curl_setopt ($Curl_Session, CURLOPT_POST, 1); curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, "Response=$response); curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1); curl_exec ($Curl_Session); curl_close ($Curl_Session); This is VERY UGLY. Is there something wrong in the mongrel server that prevents it from dealing with this request? Or, is PHP much more forgiving for poorly structured requests than Mongrel? I have no idea if the callback request is poorly structured, but given that php has no problem with it and that the API is used in a production environment, I am more inclined to think the problem is in Mongrel somewhere. Anyone? -- Posted via http://www.ruby-forum.com/. From renn at nestegg.com Wed Apr 28 21:38:17 2010 From: renn at nestegg.com (Doug Renn) Date: Wed, 28 Apr 2010 19:38:17 -0600 Subject: [Mongrel] Mongrel(_rails) crashing with rails3 Message-ID: <4BD8E309.5070702@nestegg.com> I have this problem with a real application, but here's a simple test case that's failing the same way. (using ruby 1.8.7p249) New app: $ rails rails3 create ... $ cd rails3 Add 'mongrel' to Gemfile $ bundle install Fetching source index from http://rubygems.org/ ... $ rails server => Booting Mongrel => Rails 3.0.0.beta3 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Starts with mongrel. But the following crashes: $ mongrel_rails start ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails/engine.rb:122:in `delegate': wrong argument type Symbol (expected Proc) (TypeError) from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/module/delegation.rb:121:in `each' from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/module/delegation.rb:121:in `delegate' from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails/engine.rb:127 from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails/plugin.rb:1:in `require' from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails/plugin.rb:1 from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails/application.rb:3:in `require' from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails/application.rb:3 from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails.rb:7:in `require' ... 19 levels... from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/mongrel-1.2.0.pre2/bin/../lib/mongrel/command.rb:210:in `run' from /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/mongrel-1.2.0.pre2/bin/mongrel_rails:282 from /usr/bin/mongrel_rails:19:in `load' from /usr/bin/mongrel_rails:19 Not sure where to go from here. Any help would be appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From luislavena at gmail.com Thu Apr 29 00:03:28 2010 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 29 Apr 2010 01:03:28 -0300 Subject: [Mongrel] Mongrel(_rails) crashing with rails3 In-Reply-To: <4BD8E309.5070702@nestegg.com> References: <4BD8E309.5070702@nestegg.com> Message-ID: On Wed, Apr 28, 2010 at 10:38 PM, Doug Renn wrote: > I have this problem with a real application, but here's a simple test case > that's failing the same way.? (using ruby 1.8.7p249) > > New app: > > $ rails rails3 > ????? create? ... > > $ cd rails3 > > Add 'mongrel' to Gemfile > > $ bundle install > Fetching source index from http://rubygems.org/ > ... > > $ rails server > => Booting Mongrel > => Rails 3.0.0.beta3 application starting in development on > http://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > > Starts with mongrel.? But the following crashes: > > $ mongrel_rails start > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > /Volumes/Users/renn/.rvm/gems/ruby-1.8.7-p249 at rails3/gems/railties-3.0.0.beta3/lib/rails/engine.rb:122:in > `delegate': wrong argument type Symbol (expected Proc) (TypeError) > ??????? from > > > Not sure where to go from here.? Any help would be appreciated. > There are substantial changes in the way Rails 3 bootstrap that differ considerably from what mongrel_rails is trying to perform. The problem is that mongrel_rails needs to work with older versions of Rails and newer too. I haven't played enough with Rails 3 to actually use mongrel with it, but due the changes in rails 3 bootstrap, I would rather use rack or rails server directly instead of mongrel_rails. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From rochkind at jhu.edu Thu Apr 29 10:19:51 2010 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Thu, 29 Apr 2010 10:19:51 -0400 Subject: [Mongrel] Mongrel(_rails) crashing with rails3 In-Reply-To: References: <4BD8E309.5070702@nestegg.com> Message-ID: <4BD99587.2050804@jhu.edu> Luis Lavena wrote: > > I haven't played enough with Rails 3 to actually use mongrel with it, > but due the changes in rails 3 bootstrap, I would rather use rack or > rails server directly instead of mongrel_rails. > Or passenger. I get the feeling that most developers have abandoned mongrel for passenger, and mongrel no longer has very many developers working on improving/maintaining mongrel itself either. Jonathan From luislavena at gmail.com Thu Apr 29 11:40:14 2010 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 29 Apr 2010 12:40:14 -0300 Subject: [Mongrel] Mongrel(_rails) crashing with rails3 In-Reply-To: <4BD99587.2050804@jhu.edu> References: <4BD8E309.5070702@nestegg.com> <4BD99587.2050804@jhu.edu> Message-ID: On Thu, Apr 29, 2010 at 11:19 AM, Jonathan Rochkind wrote: > Luis Lavena wrote: >> >> I haven't played enough with Rails 3 to actually use mongrel with it, >> but due the changes in rails 3 bootstrap, I would rather use rack or >> rails server directly instead of mongrel_rails. >> > > Or passenger. ? I get the feeling that most developers have abandoned > mongrel for passenger, and mongrel no longer has very many developers > working on improving/maintaining mongrel itself either. > Well, I might be biased on my response. I've been working on bring new changes to mongrel to ease the development of it and set the ground to bring better rack integration from Unicorn. You can see all these changes here: http://github.com/fauna/mongrel/commits So is not fair to say that is abandoned. While I use passenger in some server, I still use mongrel in more than 75% of all my production environments, even locally. I'm cleaning up JRuby support for a new 1.2.0 release and new ones will follow. What I have suggested about using "rails server" instead of mongrel_rails is because mongrel_rails needs to be compatible with previous version of Rails, and I'm not a 100% Rails user to explore that. See this ticket: http://github.com/fauna/mongrel/issues#issue/2 That said, if anyone work on that would happily integrate it back. Thank you. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From renn at nestegg.com Thu Apr 29 11:56:45 2010 From: renn at nestegg.com (Doug Renn) Date: Thu, 29 Apr 2010 09:56:45 -0600 Subject: [Mongrel] Mongrel(_rails) crashing with rails3 In-Reply-To: References: <4BD8E309.5070702@nestegg.com> <4BD99587.2050804@jhu.edu> Message-ID: <4BD9AC3D.7030007@nestegg.com> Passenger might be the way to go long term but right now I have some production machines that I can't take the time to upgrade/test/debug. I can't use rails server in production because I need to launch them specifying --user and --group (plus it would mean changing the whole request dispatch / process scheme I'm using). I'll try to dig deeper into this over the weekend. Any pointers would be welcomed. On 4/29/10 9:40 AM, Luis Lavena wrote: > On Thu, Apr 29, 2010 at 11:19 AM, Jonathan Rochkind wrote: > >> Luis Lavena wrote: >> >>> I haven't played enough with Rails 3 to actually use mongrel with it, >>> but due the changes in rails 3 bootstrap, I would rather use rack or >>> rails server directly instead of mongrel_rails. >>> >>> >> Or passenger. I get the feeling that most developers have abandoned >> mongrel for passenger, and mongrel no longer has very many developers >> working on improving/maintaining mongrel itself either. >> >> > Well, I might be biased on my response. > > I've been working on bring new changes to mongrel to ease the > development of it and set the ground to bring better rack integration > from Unicorn. > > You can see all these changes here: > > http://github.com/fauna/mongrel/commits > > So is not fair to say that is abandoned. > > While I use passenger in some server, I still use mongrel in more than > 75% of all my production environments, even locally. > > I'm cleaning up JRuby support for a new 1.2.0 release and new ones will follow. > > What I have suggested about using "rails server" instead of > mongrel_rails is because mongrel_rails needs to be compatible with > previous version of Rails, and I'm not a 100% Rails user to explore > that. See this ticket: > > http://github.com/fauna/mongrel/issues#issue/2 > > That said, if anyone work on that would happily integrate it back. > > Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rochkind at jhu.edu Thu Apr 29 12:00:22 2010 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Thu, 29 Apr 2010 12:00:22 -0400 Subject: [Mongrel] Mongrel(_rails) crashing with rails3 In-Reply-To: References: <4BD8E309.5070702@nestegg.com> <4BD99587.2050804@jhu.edu> Message-ID: <4BD9AD16.6050305@jhu.edu> Awesome, good to know that you're working on mongrel! If you're suggesting rack or rails server directly in Rails3... ah, but still with mongrel, just not wtih mongrel_rails? Curious what reasons you have to prefer mongrel to passenger? Jonathan Luis Lavena wrote: > On Thu, Apr 29, 2010 at 11:19 AM, Jonathan Rochkind wrote: > >> Luis Lavena wrote: >> >>> I haven't played enough with Rails 3 to actually use mongrel with it, >>> but due the changes in rails 3 bootstrap, I would rather use rack or >>> rails server directly instead of mongrel_rails. >>> >>> >> Or passenger. I get the feeling that most developers have abandoned >> mongrel for passenger, and mongrel no longer has very many developers >> working on improving/maintaining mongrel itself either. >> >> > > Well, I might be biased on my response. > > I've been working on bring new changes to mongrel to ease the > development of it and set the ground to bring better rack integration > from Unicorn. > > You can see all these changes here: > > http://github.com/fauna/mongrel/commits > > So is not fair to say that is abandoned. > > While I use passenger in some server, I still use mongrel in more than > 75% of all my production environments, even locally. > > I'm cleaning up JRuby support for a new 1.2.0 release and new ones will follow. > > What I have suggested about using "rails server" instead of > mongrel_rails is because mongrel_rails needs to be compatible with > previous version of Rails, and I'm not a 100% Rails user to explore > that. See this ticket: > > http://github.com/fauna/mongrel/issues#issue/2 > > That said, if anyone work on that would happily integrate it back. > > Thank you. > From renn at nestegg.com Thu Apr 29 14:16:53 2010 From: renn at nestegg.com (Doug Renn) Date: Thu, 29 Apr 2010 12:16:53 -0600 Subject: [Mongrel] Mongrel(_rails) crashing with rails3 In-Reply-To: <4BD9AD16.6050305@jhu.edu> References: <4BD8E309.5070702@nestegg.com> <4BD99587.2050804@jhu.edu> <4BD9AD16.6050305@jhu.edu> Message-ID: <4BD9CD15.90709@nestegg.com> It's more inertia than preference. I've been running passenger on one of our test servers, but our production environment consists of a pool of servers that run a bunch of low volume rails apps. The life cycle of these apps are managed through custom code that launches them via mongrel_rails (this setup pre-dates passenger). Passenger would be a fine solution (although I wish it provided better control over how many of which app were running), but requires a lot of testing before releasing to production. One possibility is to install passenger on the production machines but not run it in "auto-detect" mode. That way one app at a time could be moved to passenger. I need to do some more testing of that configuration. Still in the short term the shortest path for me to get a rails 3 app on our production servers is to be able to launch it via mongrel_rails. On 4/29/10 10:00 AM, Jonathan Rochkind wrote: > Awesome, good to know that you're working on mongrel! > > If you're suggesting rack or rails server directly in Rails3... ah, > but still with mongrel, just not wtih mongrel_rails? > Curious what reasons you have to prefer mongrel to passenger? > Jonathan > > Luis Lavena wrote: >> On Thu, Apr 29, 2010 at 11:19 AM, Jonathan Rochkind >> wrote: >> >>> Luis Lavena wrote: >>> >>>> I haven't played enough with Rails 3 to actually use mongrel with it, >>>> but due the changes in rails 3 bootstrap, I would rather use rack or >>>> rails server directly instead of mongrel_rails. >>>> >>>> >>> Or passenger. I get the feeling that most developers have abandoned >>> mongrel for passenger, and mongrel no longer has very many developers >>> working on improving/maintaining mongrel itself either. >>> >>> >> >> Well, I might be biased on my response. >> >> I've been working on bring new changes to mongrel to ease the >> development of it and set the ground to bring better rack integration >> from Unicorn. >> >> You can see all these changes here: >> >> http://github.com/fauna/mongrel/commits >> >> So is not fair to say that is abandoned. >> >> While I use passenger in some server, I still use mongrel in more than >> 75% of all my production environments, even locally. >> >> I'm cleaning up JRuby support for a new 1.2.0 release and new ones >> will follow. >> >> What I have suggested about using "rails server" instead of >> mongrel_rails is because mongrel_rails needs to be compatible with >> previous version of Rails, and I'm not a 100% Rails user to explore >> that. See this ticket: >> >> http://github.com/fauna/mongrel/issues#issue/2 >> >> That said, if anyone work on that would happily integrate it back. >> >> Thank you. >> > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: