users@glassfish.java.net

RE: Glassfish on Rails 2.3.4

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Sat, 26 Sep 2009 21:40:55 -0400

Rails is a MVC (Model View Controller) pattern
ROR is a standalone binary (dll/so) which implements as Apache mod_ruby module the suggested conf
http://wiki.modruby.net/en/?InstallGuide
LoadModule ruby_module /usr/local/apache/libexec/mod_ruby.so
## On Linux (FC3) this becomes
# LoadModule ruby_module /usr/lib/httpd/modules/mod_ruby.so
# ClearModuleList
# AddModule mod_ruby.c
<IfModule mod_ruby.c>
  RubyRequire apache/ruby-run
  # Execute files under /ruby as Ruby scripts
  <Location /ruby>
  SetHandler ruby-object
  RubyHandler Apache::RubyRun.instance
  </Location>
  # Execute *.rbx files as Ruby scripts
  <Files *.rbx>
  SetHandler ruby-object
  RubyHandler Apache::RubyRun.instance
  </Files>
</IfModule><VirtualHost www.yourhost.com>
ServerName www.yourhost.com
ServerAlias yourhost.com
DocumentRoot "/usr/local/railapps/public"
</VirtualHost>

where
/usr/local/railapps/public contains .htaccess
.htaccess contains
dispatch.cgi (CGI interpreter controller)
dispatch.fcgi
dispatch.rb (Ruby Interpreter controller)

http://www.yourhost.com/Controller/Action/requestID

Dispatcher looks at ending suffix if .rb then use dispatch.rb
The Dispatcher contains all the controllers
The controller calls the Action with referenced id

David Black has an excellent book on the subject which i strongly recommend
As ruby follows CGI it would make sense that Ruby (and Perl and Php) (.rb) would route thru CGIServlet
http://docs.sun.com/app/docs/doc/820-4496/ghepi?a=view

hth
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: joseph.weissman_at_smartbt.com
> To: users_at_glassfish.dev.java.net
> Date: Sat, 26 Sep 2009 16:49:00 -0400
> Subject: Glassfish on Rails 2.3.4
>
> Glassfish Team,
>
> Thanks for the followup! The issue I'm having running Rails 2.3.4 on
> Glassfish, again, seems to be related to the Jruby implementation of Rack.
>
> I'm able to 'deploy' my (vanilla Rails) application without issue, but as
> soon as I attempt to launch it I'm greeted with the cheerful "We're sorry,
> but something went wrong!" in the browser. The exception which is thrown in
> the Glassfish console is as follows:
>
> .../my_app/WEB-INF/gems/gems/actionpack-2.3.4/lib/action_controller/middlewa
> re_stack.rb:72 in 'build': undefined method 'new' for "Rack::Head":String
> (NoMethodError)
>
> As far as my environment, I'm running Rails 2.3.4 on Glassfish v2.1 Prelude,
> JRuby v1.2.0 (with Rack 1.0.0 installed inside it), and building .wars with
> Warbler v0.9.14. (As far as I know, these should be latest versions of
> each.)
>
> It's a nearly-empty Rails application, so I figured (logically or not) that
> someone else must have tried this already, and run into similar problems.
>
> Note the application runs just fine using 'jruby -S script/server'...
>
> Cordially,
>
>
>
> Joseph Weissman
>
> Programmer Analyst
>
>
>
> Office: (866) 455 4100
>
> Personal: (770) 363 8723
>
> E-mail: joseph.weissman_at_smartbt.com
>
>
>
> Smart Business Technology, Inc.
>
> 655 Hembree Parkway, Suite G
>
> Roswell, GA 30076
>
>
> -----Original Message-----
> From: Hassan Schroeder [mailto:hassan.schroeder_at_gmail.com]
> Sent: Saturday, September 26, 2009 3:10 PM
> To: users_at_glassfish.dev.java.net
> Subject: Re: Glassfish on Rails 2.3.4
>
> On Sat, Sep 26, 2009 at 11:36 AM, Joseph Weissman
>
> > However, we've been having some trouble getting .war files deploying
> > to GF using Rails 2.3.4. (It seems as though JRuby's version of Rack
> > has some
> > issues?) At any rate we've tried several suggestions and patches but
> > are nevertheless no closer to getting a 2.3.4 Rails app deploying on
> Glassfish.
>
> > We were hoping that these issues had already been encountered
>
> Lacking perfect mind-reading ability, I, at least, would find it helpful if
> you'd describe exactly what "issues" you're having. :-)
>
> You might also want to tell us the versions of JRuby, jruby-rack, and
> warbler (assuming that's what you're using to build your war files), plus
> anything else relevant to your environment.
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder_at_gmail.com
> twitter: @hassan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.13.99/2372 - Release Date: 09/26/09
> 05:51:00
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
                                                _________________________________________________________________ Microsoft brings you a new way to search the web. Try Bing™ now http://www.bing.com?form=MFEHPG&publ=WLHMTAG&crea=TEXT_MFEHPG_Core_tagline_try bing_1x1
--_280f8502-7a92-4957-82c9-72544c55688f_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Rails is a MVC (Model View Controller) pattern<br>ROR is a standalone binary (dll/so) which implements as Apache mod_ruby module the suggested conf<br>http://wiki.modruby.net/en/?InstallGuide<br><pre>LoadModule ruby_module /usr/local/apache/libexec/mod_ruby.so<br>## On Linux (FC3) this becomes<br># LoadModule ruby_module /usr/lib/httpd/modules/mod_ruby.so <br># ClearModuleList<br># AddModule mod_ruby.c<br>&lt;IfModule mod_ruby.c&gt;<br> RubyRequire apache/ruby-run<br> # Execute files under /ruby as Ruby scripts<br> &lt;Location /ruby&gt;<br> SetHandler ruby-object<br> RubyHandler Apache::RubyRun.instance<br> &lt;/Location&gt;<br> # Execute *.rbx files as Ruby scripts<br> &lt;Files *.rbx&gt;<br> SetHandler ruby-object<br> RubyHandler Apache::RubyRun.instance<br> &lt;/Files&gt;<br>&lt;/IfModule&gt;</pre>&lt;VirtualHost www.yourhost.com&gt;<br>ServerName www.yourhost.com<br>ServerAlias yourhost.com<br>DocumentRoot "/usr/local/railapps/public"<br>&lt;/VirtualHost&gt;<br><br>where<br>/usr/local/railapps/public contains .htaccess<br>.htaccess contains<br>dispatch.cgi (CGI interpreter controller)<br>dispatch.fcgi<br>dispatch.rb (Ruby Interpreter controller)<br><br>http://www.yourhost.com/Controller/Action/requestID<br><br>Dispatcher looks at ending suffix if .rb then use dispatch.rb<br>The Dispatcher contains all the controllers<br>The controller calls the Action with referenced id<br><br>David Black has an excellent book on the subject which i strongly recommend<br>As ruby follows CGI it would make sense that Ruby (and Perl and Php) (.rb) would route thru CGIServlet<br>http://docs.sun.com/app/docs/doc/820-4496/ghepi?a=view<br><br>hth<br>Martin Gainty <br>______________________________________________ <br>Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité<br><div>&nbsp;<br>Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.<br></div><pre>Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.</pre><br><br><br><br><br>&gt; From: joseph.weissman@smartbt.com<br>&gt; To: users@glassfish.dev.java.net<br>&gt; Date: Sat, 26 Sep 2009 16:49:00 -0400<br>&gt; Subject: Glassfish on Rails 2.3.4<br>&gt; <br>&gt; Glassfish Team,<br>&gt; <br>&gt; Thanks for the followup! The issue I'm having running Rails 2.3.4 on<br>&gt; Glassfish, again, seems to be related to the Jruby implementation of Rack.<br>&gt; <br>&gt; I'm able to 'deploy' my (vanilla Rails) application without issue, but as<br>&gt; soon as I attempt to launch it I'm greeted with the cheerful "We're sorry,<br>&gt; but something went wrong!" in the browser. The exception which is thrown in<br>&gt; the Glassfish console is as follows:<br>&gt; <br>&gt; .../my_app/WEB-INF/gems/gems/actionpack-2.3.4/lib/action_controller/middlewa<br>&gt; re_stack.rb:72 in 'build': undefined method 'new' for "Rack::Head":String<br>&gt; (NoMethodError)<br>&gt; <br>&gt; As far as my environment, I'm running Rails 2.3.4 on Glassfish v2.1 Prelude,<br>&gt; JRuby v1.2.0 (with Rack 1.0.0 installed inside it), and building .wars with<br>&gt; Warbler v0.9.14. (As far as I know, these should be latest versions of<br>&gt; each.)<br>&gt; <br>&gt; It's a nearly-empty Rails application, so I figured (logically or not) that<br>&gt; someone else must have tried this already, and run into similar problems.<br>&gt; <br>&gt; Note the application runs just fine using 'jruby -S script/server'...<br>&gt; <br>&gt; Cordially,<br>&gt; <br>&gt; <br>&gt; <br>&gt; Joseph Weissman<br>&gt; <br>&gt; Programmer Analyst<br>&gt; <br>&gt; <br>&gt; <br>&gt; Office: (866) 455 4100<br>&gt; <br>&gt; Personal: (770) 363 8723<br>&gt; <br>&gt; E-mail: joseph.weissman@smartbt.com<br>&gt; <br>&gt; <br>&gt; <br>&gt; Smart Business Technology, Inc.<br>&gt; <br>&gt; 655 Hembree Parkway, Suite G<br>&gt; <br>&gt; Roswell, GA 30076<br>&gt; <br>&gt; <br>&gt; -----Original Message-----<br>&gt; From: Hassan Schroeder [mailto:hassan.schroeder@gmail.com] <br>&gt; Sent: Saturday, September 26, 2009 3:10 PM<br>&gt; To: users@glassfish.dev.java.net<br>&gt; Subject: Re: Glassfish on Rails 2.3.4<br>&gt; <br>&gt; On Sat, Sep 26, 2009 at 11:36 AM, Joseph Weissman<br>&gt; <br>&gt; &gt; However, we've been having some trouble getting .war files deploying <br>&gt; &gt; to GF using Rails 2.3.4. (It seems as though JRuby's version of Rack <br>&gt; &gt; has some<br>&gt; &gt; issues?) At any rate we've tried several suggestions and patches but <br>&gt; &gt; are nevertheless no closer to getting a 2.3.4 Rails app deploying on<br>&gt; Glassfish.<br>&gt; <br>&gt; &gt; We were hoping that these issues had already been encountered<br>&gt; <br>&gt; Lacking perfect mind-reading ability, I, at least, would find it helpful if<br>&gt; you'd describe exactly what "issues" you're having. :-)<br>&gt; <br>&gt; You might also want to tell us the versions of JRuby, jruby-rack, and<br>&gt; warbler (assuming that's what you're using to build your war files), plus<br>&gt; anything else relevant to your environment.<br>&gt; <br>&gt; --<br>&gt; Hassan Schroeder ------------------------ hassan.schroeder@gmail.com<br>&gt; twitter: @hassan<br>&gt; <br>&gt; ---------------------------------------------------------------------<br>&gt; To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net<br>&gt; For additional commands, e-mail: users-help@glassfish.dev.java.net<br>&gt; <br>&gt; No virus found in this incoming message.<br>&gt; Checked by AVG - www.avg.com<br>&gt; Version: 8.5.409 / Virus Database: 270.13.99/2372 - Release Date: 09/26/09<br>&gt; 05:51:00<br>&gt; <br>&gt; <br>&gt; ---------------------------------------------------------------------<br>&gt; To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net<br>&gt; For additional commands, e-mail: users-help@glassfish.dev.java.net<br>&gt; <br> <br /><hr />Microsoft brings you a new way to search the web. <a href='http://www.bing.com?form=MFEHPG&publ=WLHMTAG&crea=TEXT_MFEHPG_Core_tagline_try bing_1x1' target='_new'>Try Bing™ now</a></body>
</html>
--_280f8502-7a92-4957-82c9-72544c55688f_--