# Setup IIS for ruby on rails

**URL:** <https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079>\
**Category:** Deployment\
**Created:** [February 14, 2008, 1:06am UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079 "2008-02-14T01:06:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 14, 2008, 1:06am UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/1 "2008-02-14T01:06:15Z")

</div>

Hi All,

I am new in learning ruby on rails. And now I’m trying to do set up for  
ruby on rails in IIS  
I follow instructions from one of site and then when I try to run the  
page [http://localhost/index.rhtml](http://localhost/index.rhtml), it comes an error like this :

CGI Error  
The specified CGI application misbehaved by not returning a complete set  
of HTTP headers. The headers it did return are:

C:\first\app\views\first\index.rhtml:9: undefined method `form\_tag’ for  
main:Object (NoMethodError)

Does anyone here know what’s wrong? maybe i’ve missed some settings but  
i have no idea what is wrong

Thanks a lot in advance for your help

best regards,  
Jaan

---

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 14, 2008, 3:06pm UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/2 "2008-02-14T15:06:34Z")

</div>

Jaan.

```
I would recommend first running the application using Webrick, or

```

Mongrel to be sure it is working properly, right now you are trying to  
access directly a rhtml template, and you have error in it.

```
And after that start try serving it using some of the recipes in:

http://www.napcs.com/howto/rails/deploy/

```

–  
Aníbal

On Feb 14, 7:06 pm, Jaan J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 15, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/3 "2008-02-15T15:37:21Z")

</div>

Having been doiing rails development in wndows and linux for a while  
now.  
Always start your testing using mongel, using

ruby script/server  
in your project direcotry.

(Or your ide can run it).

In production for a small set of users, run a single mongrel as a  
windows service, you can always redirect using a web page in iis if  
your  
really must use iis.

For production, windows is not the way to go for anything serious.  
Using nginx and a mongrel cluster.

---

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 20, 2008, 5:33am UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/4 "2008-02-20T05:33:24Z")

</div>

Hi Anibal and glennswest,

Thanks a lot for your help.  
I tried to use Mongrel and integrate it with IIS and now it’s working  
Thanks guys

Just one more thing, now it’s running for single Mongrel  
what i’m trying to do now for next step is I want to run another Rails  
application but I dont want to create another Mongrel service  
I read from somewhere that I can use Mongrel cluster  
But after I created mongrel cluster with mongrel\_cluster.yml, when I  
tried to start my mongrel\_cluster service, it returns error something  
like this :

C:\rails\myapp1\>mongrel\_rails cluster::start  
starting port 3010  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel\_cluster-1.0.5/lib/mongrel\_cluster/init.rb:98:  
in ``’: Exec format error - mongrel\_rails start -d -e production -a  
127.0.0.1 -c C:\rails\myapp1 --prefix /myapp1 -p 3010 -P  
tmp/pids/mongrel.3010.pid -l log/mongrel.3010.log (Errno::ENOEXEC)  
…  
…  
from c:/ruby/bin/mongrel\_rails:16:in ‘load’  
from c:/ruby/bin/mongrel\_rails:16

Can you guys give me clue how to solve this matter?

Thank you in advance

regards,  
Jaan

glennswest wrote:

> Having been doiing rails development in wndows and linux for a while  
> now.  
> Always start your testing using mongel, using
> 
> ruby script/server  
> in your project direcotry.
> 
> (Or your ide can run it).
> 
> In production for a small set of users, run a single mongrel as a  
> windows service, you can always redirect using a web page in iis if  
> your  
> really must use iis.
> 
> For production, windows is not the way to go for anything serious.  
> Using nginx and a mongrel cluster.

---

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 20, 2008, 5:45am UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/5 "2008-02-20T05:45:01Z")

</div>

On Feb 20, 2008 2:33 AM, Jaan J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi Anibal and glennswest,
> 
> Thanks a lot for your help.  
> I tried to use Mongrel and integrate it with IIS and now it’s working  
> Thanks guys
> 
> Just one more thing, now it’s running for single Mongrel  
> what i’m trying to do now for next step is I want to run another Rails  
> application but I dont want to create another Mongrel service

Is not possible use the same ruby process for two different rails  
applications.

That is design limitation of Rails and not Mongrel.

> I read from somewhere that I can use Mongrel cluster  
> But after I created mongrel cluster with mongrel\_cluster.yml, when I  
> tried to start my mongrel\_cluster service, it returns error something  
> like this :

Mongrel cluster leverage in functionality only available in posix  
compliant OS (forking also known as daemonize). That is not possible  
to implement in Windows without replacing things and adding big  
conditional blocks to call Win32 API.

In any case, having one service for each application is a good  
practice. You can restart each application individually from each  
other.

In case you want to implement a “cluster” of the same application,  
that’s another story that currently is not doable with  
mongrel\_service.

Right now the only workaround is creating a service for each application  
port:

my-app-3000  
my-app-3001  
my-app-3002  
etc.

Then you can trick all these services to depend on the previous one,  
so doing a “net start my-app-3004” will cascade the net start command  
down to my-app-3000.

That’s a nice trick but can be tricky get it set (maybe it deserves a  
separate post) 😃

## Regards,

## Luis L. Multimedia systems

A common mistake that people make when trying to design  
something completely foolproof is to underestimate  
the ingenuity of complete fools.  
Douglas Adams

---

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 20, 2008, 7:17am UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/6 "2008-02-20T07:17:51Z")

</div>

Hi Luis,

Ah okey so it’s really not possible to use same ruby process for  
multiple rails applications…  
Thanks for your help.

It’s working now for me after I made 2 mongrel services for 2 different  
rails applications and then added 2 lines for RewriteProxy(for each  
mongrel services) in my ISAPI Rewrite 3

Thanks Luis

Best regards,  
Jaan

---

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 22, 2008, 12:08pm UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/7 "2008-02-22T12:08:15Z")

</div>

Have a look at this one:

[http://switchpipe.org/](http://switchpipe.org/)

On Feb 20, 2:17 pm, Jaan J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jaan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jaan](https://www.ruby-forum.com/u/jaan)\
**Post date:** [February 23, 2008, 5:35pm UTC](https://www.ruby-forum.com/t/setup-iis-for-ruby-on-rails/129079/8 "2008-02-23T17:35:41Z")

</div>

Interesting stuff. thanks for talking about it!
