Setup IIS for ruby on rails

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, 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

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. [email protected]

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.

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.

On Feb 20, 2008 2:33 AM, Jaan J. [email protected]
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) :smiley:

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

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

Have a look at this one:

http://switchpipe.org/

On Feb 20, 2:17 pm, Jaan J. [email protected]

Interesting stuff. thanks for talking about it!