mod_ruby & rails doc?

A

Aquila

Is there a place where I can find information on using mod_ruby? A single
stupid example will do, I just can't find anything...
I guess once I get mod_ruby working rails will work too? I don't find any
information on that combination either.

I'm anxious to start using rails!
 
D

Dick Davies

* Aquila said:
Is there a place where I can find information on using mod_ruby? A single
stupid example will do, I just can't find anything...

http://www.modruby.net ?
I guess once I get mod_ruby working rails will work too? I don't find any
information on that combination either.

I'm anxious to start using rails!

you don't need modruby to use rails.
 
B

Brian McCallister

You can use it with mod_ruby. I think FastCGI is probably used more
(happens to be what I use as well) and is quite performant.

-Brian
 
S

Sarah Tanembaum

Brian said:
You can use it with mod_ruby. I think FastCGI is probably used more
(happens to be what I use as well) and is quite performant.

-Brian

It will probably be my fault but I can't find any example on
modruby.net? I
really can't find a complete script...



But if I prefer not to use CGI I read it's possible to use Rails with
mod_ruby. Or am I misinformed?
Using the mod_ruby gives web application more bags of tools that comes
with Apache, just like the mod_php. And also, it is easier to manage
since it is integrated with Apache.

Some have claimed that FastCGI is faster than mod_ruby, can anyone
validate these claims? Because I can hardly believe that CGI is faster
than the embedded interpreter.

Thanks
 
D

David Heinemeier Hansson

Using the mod_ruby gives web application more bags of tools that comes
with Apache, just like the mod_php. And also, it is easier to manage
since it is integrated with Apache.

Some have claimed that FastCGI is faster than mod_ruby, can anyone
validate these claims? Because I can hardly believe that CGI is faster
than the embedded interpreter.

mod_ruby uses one interpreter per Apache process, which means that apps
walk all over each other in the namespaces. At least for Rails, that's
not acceptable, so it's 1 app per Apache setup if you want mod_ruby.

FCGI is a much better setup for Rails. You don't fill up a ton of
Apache processes with your app (so apache processes serving static
files and images stay small) and you can have as many apps per apache
setup as you'd like.

I've found FCGI to be 10-15% faster in my tests with Rails.
--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://macromates.com/ -- TextMate: Code and markup editor (OS X)
http://www.loudthinking.com/ -- Broadcasting Brain
 
J

James Britt

Sarah said:
Using the mod_ruby gives web application more bags of tools that comes
with Apache, just like the mod_php. And also, it is easier to manage
since it is integrated with Apache.

Some have claimed that FastCGI is faster than mod_ruby, can anyone
validate these claims? Because I can hardly believe that CGI is faster
than the embedded interpreter.

I believe this is because FastCGI keeps one or more Ruby interpreters in
memory, rather than creating a new process on each Web request.

Bear in mind that with mod_ruby, all Web applications are sharing the
same interpreter, and the same object space.

James
 
A

Aquila

Aquila said:
Is there a place where I can find information on using mod_ruby? A single
stupid example will do, I just can't find anything...

Doesn't anyone use mod_ruby then? Does everyone use Rails? There must be
some example lying around somewhere...

Thanks for your help and ruby!
 
J

Jeffrey Dik

Doesn't anyone use mod_ruby then? Does everyone use Rails? There must be
some example lying around somewhere...

There's mod_ruby examples on:
http://www.modruby.net/en/doc/?FAQ
but perhaps
http://sean.chittenden.org/programming/ruby/mod_ruby/apachecon-2002/mod_ruby_intro.html
would be more useful.

I have been using rails with mod_ruby, but have been getting some
transient errors. I just switched to using mod_fastcgi, and so far it
seems to be both faster and error-free.

HTH,
Jeff
 
D

David Garamond

Aquila said:
Doesn't anyone use mod_ruby then? Does everyone use Rails? There must be
some example lying around somewhere...

mod_ruby doesn't have to be used to create a webapp, you know :) I use
mod_ruby to customize & extend Apache behaviour (e.g. custom URL
mapping, URL filtering, and flexible wrapped CGI execution). It's so
much easier and faster using Ruby to create Apache modules instead of C.

Oh and I use plain Ruby CGI and FastCGI too.
 
A

Aquila

David said:
mod_ruby doesn't have to be used to create a webapp, you know :)

I don't understand it, you need some sort of layer on top of apache to use
server sided scripting with apache, and if you don't you can use webrick or
some other stand alone http server, right?
I use
mod_ruby to customize & extend Apache behaviour (e.g. custom URL
mapping, URL filtering, and flexible wrapped CGI execution). It's so
much easier and faster using Ruby to create Apache modules instead of C.
You are writing your own mod_filtering etc? That sounds really interesting.
Can I find your code somewhere?
Oh and I use plain Ruby CGI and FastCGI too.
By plain Ruby CGI you mean Ruby on top of "regular" Apache CGI?
To end a message from a confused person: I do understand what you mean by
FastCGI...

Thanks for the information!
 
D

David Garamond

Aquila said:
I don't understand it, you need some sort of layer on top of apache to use
server sided scripting with apache, and if you don't you can use webrick or
some other stand alone http server, right?

What I meant was that, mod_ruby is a tool that binds Ruby to Apache. You
can of course use mod_ruby to create web applications (i.e. generate
dynamic HTML/XHTML pages with Ruby interpreter embedded inside Apache).
But you can also use mod_ruby for other purposes than generating dynamic
pages (e.g. for an admin like me, mod_ruby makes Apache more useful
because I can extend it easily with Ruby code. This way Ruby works
behind the layer and doesn't always have anything to do page generation
at all).

So it's not always appropriate to compare mod_ruby with FastCGI or even
rails. They do different things.
You are writing your own mod_filtering etc? That sounds really interesting.
Can I find your code somewhere?

Sorry, much of it is internal stuffs. I used to use mod_perl though, and
there are many examples (even books) for that. Most of them can be
applied pretty easily for mod_ruby too.
By plain Ruby CGI you mean Ruby on top of "regular" Apache CGI?

Yes. (It doesn't always have to be Apache, of course. CGI is a generic
protocol that's supported by most webservers).
To end a message from a confused person: I do understand what you mean by
FastCGI...

Thanks for the information!

You're welcome!
 
S

Sarah Tanembaum

David said:
What I meant was that, mod_ruby is a tool that binds Ruby to Apache. You
can of course use mod_ruby to create web applications (i.e. generate
dynamic HTML/XHTML pages with Ruby interpreter embedded inside Apache).
But you can also use mod_ruby for other purposes than generating dynamic
pages (e.g. for an admin like me, mod_ruby makes Apache more useful
because I can extend it easily with Ruby code. This way Ruby works
behind the layer and doesn't always have anything to do page generation
at all).

So it's not always appropriate to compare mod_ruby with FastCGI or even
rails. They do different things.



Sorry, much of it is internal stuffs. I used to use mod_perl though, and
there are many examples (even books) for that. Most of them can be
applied pretty easily for mod_ruby too.



Yes. (It doesn't always have to be Apache, of course. CGI is a generic
protocol that's supported by most webservers).



You're welcome!
I too like to see more application in mod_ruby/eruby and take advantage
of rich features that came in with Apache. I came from the PHP camp,
which has worked for me for both the Linux, Solaris, and Windows
platform beautifully, and mod_ruby would do a better job since the
language itself, Ruby, is, IMO, a better language than PHP.

But, I always hit a snag in Windows implementation of mod_ruby. Until
recently that someone is nice enough to work it out on Windows,
therefore I can explore more of mod_ruby/eruby.

Just an FYI, there are a newsgroup dedicated to mod_ruby,
gmane.comp.apache.mod-ruby
gmane.comp.editors.mod-ruby.devel
....

Just my 2 cents.

Sarah
 
M

Michael Granger

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Doesn't anyone use mod_ruby then? Does everyone use Rails? There must
be
some example lying around somewhere...

I've written a humble little framework around mod_ruby called Arrow:

http://www.rubycrafters.com/projects/Arrow/

It has neither the developer resources nor groundswell of interest that
Rails does, but I find it quite useful.

- --
Michael Granger <[email protected]>
Rubymage, Believer, Architect
The FaerieMUD Consortium <http://www.FaerieMUD.org/>
ruby -e "p 12383406064495388618631689469409153107.to_s(36).tr('z',' ')"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (Darwin)

iD8DBQFCKISt+zlz4UKpE6QRArqZAKCCh59DeGA3WKS6exETcxZTRnrE3ACgj41S
GcUiswyy1TuSKXLoHCjAavo=
=68c6
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,178
Latest member
Crypto Tax Software
Top