mongrel

Change default server for Rails

有些话、适合烂在心里 提交于 2020-01-06 08:28:22
问题 I installed the mongrel gem because I need it on my workstation for rare occasions, and now it's my default Rails (2) server. I know I could specify script/server webrick on the command line, but the fact is that I'd like to have my system (or app) default to webrick, and only use mongrel when specified. Anybody know how to arrange that? Specs: WinXP, Rails 2.3.12, Ruby 1.8.7 回答1: Ok here are a few options: Option one - One off: Always add webrick as a command line arg Open script/server and

Rails 3 - Windows + Mongrel (Error with dispatcher)

拟墨画扇 提交于 2020-01-06 07:46:13
问题 I am trying to deploy a rails 3 app to a windows machine (yes it has to be windows, I cannot use linux) I decided to try and use Mongrel + Apache (willing to try other setups if anyone knows one that works). I have mongrel installed and I can run rails server mongrel and run my app fine. However when I try to start mongrel as a windows service using mongrel_rails service::install -N mongrel1 -e production -p 3001 -c mydirectory` I run into trouble. The server starts fine but when I try to get

First request to Rails app is very slow

老子叫甜甜 提交于 2020-01-01 11:35:34
问题 always the first request (of a working session) to my Rails app is lagging. Switching to production mode doesn't help. I use mongrel and the other requests are handled with acceptable speed. How do I make it faster? Regards 回答1: If you post the contents of the log as that first request is processed then perhaps we can figure out what's making it so slow. For example, this is my log as the first user accesses the site Booting Mongrel (use 'script/server webrick' to force WEBrick) Rails 2.1.0

First request to Rails app is very slow

北战南征 提交于 2020-01-01 11:35:11
问题 always the first request (of a working session) to my Rails app is lagging. Switching to production mode doesn't help. I use mongrel and the other requests are handled with acceptable speed. How do I make it faster? Regards 回答1: If you post the contents of the log as that first request is processed then perhaps we can figure out what's making it so slow. For example, this is my log as the first user accesses the site Booting Mongrel (use 'script/server webrick' to force WEBrick) Rails 2.1.0

How do you restart Rails under Mongrel, without stopping and starting Mongrel

会有一股神秘感。 提交于 2019-12-30 06:19:01
问题 Is there a way to restart the Rails app (e.g. when you've changed a plugin/config file) while Mongrel is running. Or alternatively quickly restart Mongrel. Mongrel gives these hints that you can but how do you do it? ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. 回答1: You can add the -c option if the config for your app's cluster is elsewhere: mongrel_rails cluster::restart -c

How to solve the memory-leak with send_file (or send_data) on Heroku?

房东的猫 提交于 2019-12-24 14:06:26
问题 I have a Rails 3 app that needs to generate an image and send the data to the browser. The app must be deployed on Heroku. However, Heroku only supports streaming through Mongrel which holds on to the memory. This then causes Heroku to slow, then kill the thread after a dozen or so requests. https://devcenter.heroku.com/articles/error-codes#r14-memory-quota-exceeded I am currently using send_data or send_file from ActionController::DataStreaming http://api.rubyonrails.org/classes

Problems running Ruby on Rails apps on shared hosted server

♀尐吖头ヾ 提交于 2019-12-22 12:23:41
问题 I have problems installing any Ruby On Rails app on my shared hosted server. Mongrel shows html as plain text for all pages. The problem occurs for any app, even if I create a test empty app and add a scaffolded view without changing anything. It appears that the Mongrel crashes when trying to put cookies to the response header. The HTTP header looks incomplete, the Content-type and other parameters are missing: curl 127.0.0.1:12002/users -I HTTP/1.1 200 OK Connection: close Date: Wed, 26 May

Mongrel::DirHandler equivalent for Passenger

一个人想着一个人 提交于 2019-12-22 10:33:34
问题 I'm using Mongrel::DirHandler to control response headers for static files - this works great on my dev machine. My production machine uses Passenger so my headers aren't getting set. How do I control headers for static files when using Passenger? snippet from my environment.rb: if defined? Mongrel::DirHandler module Mongrel class DirHandler def send_file_with_expires(req_path, request, response, header_only=false) if req_path =~ /((\/images)|javascripts|stylesheets)/ response.header['Cache

Error calling Dispatcher.dispatch #<NameError: uninitialized constant ActionController::CgiRequest

你说的曾经没有我的故事 提交于 2019-12-22 10:29:31
问题 I'm getting the following error on log/mongrel.6001.log I'm using mongrel_cluster , rails 3 and ruby 1.8.7 I start mongrel_cluster using mongrel_rails cluster::start But when I try to access the page on browser I get the error bellow "Error calling Dispatcher.dispatch # Mon Oct 11 00:26:04 -0500 2010: Error calling Dispatcher.dispatch #<NameError: uninitialized constant ActionController::CgiRequest> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process' /usr/lib

How to do a rolling restart of a cluster of mongrels

百般思念 提交于 2019-12-22 04:43:32
问题 Anybody know a nice way to restart a mongrel cluster via capistrano in a "rolling" style, eg, one mongrel at a time. Would be great to have a bit of wait time in there as well for each, to let the mongrel load the rails app up as well. I've done some searching, and haven't found too much, so looking for help before I dive into the mongrel_cluster gem myself. Thanks! 回答1: I agree with the seesaw approach more than the rolling approach you are seeking. The problem is that you end up in