<p>As popular as Ruby and Rails are, it seems like this problem would already be solved. JRuby and mod_rails are all fine and dandy, but why isn't there an Apache mod for just straight Ruby?</p>

[{'answer_id': 75095, 'author': 'AShelly', 'author_id': 10396, 'author_profile': 'https://Stackoverflow.com/users/10396', 'pm_score': 2, 'selected': False, 'text': '<p>There is one:  <a href="http://www.modruby.net/en/" rel="nofollow noreferrer">mod_ruby</a>, but it hasn\'t been maintained in about 2 years.</p>\n'}, {'answer_id': 75217, 'author': 'mislav', 'author_id': 11687, 'author_profile': 'https://Stackoverflow.com/users/11687', 'pm_score': 5, 'selected': False, 'text': '<p>There is <a href="http://www.modrails.com/" rel="nofollow noreferrer">Phusion Passenger</a>, a robust Apache module that can run <a href="http://rack.rubyforge.org/" rel="nofollow noreferrer">Rack</a> applications with minimum configuration. It\'s becoming appealing to shared hosts, and turning any program into a Rack application is ridiculously easy:</p>\n\n<blockquote>\n  <p>A Rack application is an Ruby <strong>object</strong>\n  (not a class) that responds to <code>call</code>.\n  It takes exactly <em>one argument</em>, the\n  environment and returns an Array of\n  exactly <em>three values</em>: The status, the\n  headers, and the body.</p>\n</blockquote>\n'}, {'answer_id': 75628, 'author': 'Nate', 'author_id': 12779, 'author_profile': 'https://Stackoverflow.com/users/12779', 'pm_score': 3, 'selected': False, 'text': '<p>It\'s perhaps worth double-clarifying mislav\'s point that mod_rails isn\'t actually limited to Rails code at all. The new name, mod_rack, is way better. Trivially small apps can be rackable -- their example being:</p>\n\n<pre><code>class HelloWorld\n  def call(env)\n    [200, {"Content-Type" =&gt; "text/plain"}, ["Hello world!"]]\n  end\nend\n</code></pre>\n'}, {'answer_id': 76089, 'author': 'Honza', 'author_id': 8621, 'author_profile': 'https://Stackoverflow.com/users/8621', 'pm_score': 0, 'selected': False, 'text': '<p>There is <a href="http://www.modrails.com/" rel="nofollow noreferrer">mod_rails</a> and it can run <a href="http://rack.rubyforge.org/" rel="nofollow noreferrer">Rack</a> applications, what more can you need?</p>\n'}, {'answer_id': 109518, 'author': 'Jörg W Mittag', 'author_id': 2988, 'author_profile': 'https://Stackoverflow.com/users/2988', 'pm_score': 5, 'selected': True, 'text': '<p>The basic problem is this: for a long time, MRI was the only feasible Ruby Implementation. MRI has a number of problems that make it hard to embed it into another application (which is basically what <a href="http://ModRuby.Net/" rel="noreferrer">mod_ruby</a> does: it embeds MRI in Apache), especially a multi-threaded one (which Apache is). It is not particularly thread-safe and it has quite a bit of global state.</p>\n\n<p>This global state means for example that if one Rails application modifies some class, then <em>all other</em> Rails applications that run on the same Apache server, will <em>also</em> see this modified class.</p>\n\n<p>Another problem is that the MRI source code is not easily hackable. MRI is now more than 15 years old, and it\'s starting to show.</p>\n\n<p>As a result of these problems, mod_ruby has never <em>really</em> properly worked, and at some point the maintainers simply gave up.</p>\n\n<p>The C based PHP interpreter, on the other hand, was designed from day one to be run as mod_php inside Apache. Indeed, for the first couple of versions, there wasn\'t even a commandline version of the interpreter, mod_php was the <em>only</em> way to run PHP.</p>\n\n<p><a href="http://ModRails.Com/" rel="noreferrer">Phusion Passenger (aka mod_rack aka mod_rails)</a> solves this problem by basically giving up and sidestepping the problem: they simply run a seperate copy of MRI in a seperate process for every application. It works great, and not only for Ruby. It supports <a href="http://WSGI.Org/" rel="noreferrer">WSGI</a> (standard interface for Python Web Frameworks), <a href="http://Rack.RubyForge.Org/" rel="noreferrer">Rack</a> (standard interface for Ruby Web Frameworks) and direct support for Ruby on Rails.</p>\n\n<p>My hopes are on <a href="https://GitHub.Com/rue/mod_rubinius/" rel="noreferrer">mod_rubinius</a>, which unfortunately doesn\'t exist yet. <a href="http://Rubini.us/" rel="noreferrer">Rubinius</a> was designed from the beginning to be thread-safe, embeddable, free of global state, not use the C stack and so on. It was designed to be able to run multiple Rubinius VMs inside one Rubinius process. This makes mod_rubinius infinitely easier to implement and maintain than mod_ruby. Unfortunately, of course, Rubinius is not released yet, and the real work on mod_rubinius cannot even begin until Rubinius is released. The good news is that mod_rubinius already has more manpower behind it than mod_ruby ever had, because it has paid developers working on it by a Rails hosting company that <em>desperately</em> wants to use it themselves.</p>\n'}]
['https://Stackoverflow.com/questions/75001', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6726/']