# Action working with webrick, not with apache+fcgi

**URL:** <https://www.ruby-forum.com/t/action-working-with-webrick-not-with-apache-fcgi/162548>\
**Category:** Rails\
**Created:** [March 11, 2009, 8:14am UTC](https://www.ruby-forum.com/t/action-working-with-webrick-not-with-apache-fcgi/162548 "2009-03-11T08:14:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [March 11, 2009, 8:14am UTC](https://www.ruby-forum.com/t/action-working-with-webrick-not-with-apache-fcgi/162548/1 "2009-03-11T08:14:16Z")

</div>

Hello,

I have a stange problem that I don’t know how to solve.

My application is deployed and configured to use Apache and Fastcgi (I  
use a hosting company).

It works ok except for some redirect where apparently the wrong route  
is used.  
I have tried on the same environment with webrick (with the command  
script/server) and it works ok. I suspect a problem with Apache  
configuration but don’t know how to diagnose.

Here is the configuration where the problem occurs:  
I have a remote form which call an action as followed

\<% remote\_form\_for :building, :url =\> created\_path do |f| -%\>

The action created is executed until it reaches the following  
redirection  
render :update do |page| page.redirect\_to building\_blocks\_path  
(@building) end

and instead of going to the index action of the blocks controller it  
loops on the created action and there is nothing special in the log  
except

- Completed in 0.79187 (1 reqs/sec) | Rendering: 0.00394 (0%) | DB:  
0.73004 (92%) | 200 OK [[http://int.notreimmeuble.com/created](http://int.notreimmeuble.com/created)]  
and a 500 Internal Server Error in the javascript response (with the  
message in the ErrorDocument 500 in htaccess)  
(again this same code works well with webrick started on the same  
environment).

Here is the htaccess used (and recommended by my hoster)  
AddHandler fcgid-script .fcgi  
Options +FollowSymLinks +ExecCGI  
RewriteEngine On  
RewriteRule ^$ index.html [QSA]  
RewriteRule ^([^.]+)$ $1.html [QSA]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 “

## Erreur de l’application
L’application n’a  
pas démarré, contacter l’administrateur”

Any advice for a solution would be very welcome  
Thanks  
Nicolas

---

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [March 12, 2009, 11:50am UTC](https://www.ruby-forum.com/t/action-working-with-webrick-not-with-apache-fcgi/162548/2 "2009-03-12T11:50:18Z")

</div>

Hello,

Sorry to be insistant but I am stuck with this problem and I don’t  
know how to move forward.

Nicolas

---

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [March 19, 2009, 9:40am UTC](https://www.ruby-forum.com/t/action-working-with-webrick-not-with-apache-fcgi/162548/3 "2009-03-19T09:40:34Z")

</div>

Hello,

Just for your information, I have found the issue.  
The problem came from the fact that I had left a “puts” in my code and  
apparently writting on the console with mod\_fcgi makes the application  
fail

Nicolas
