tag:blogger.com,1999:blog-20975090.post667086880064943824..comments2024-03-11T10:18:55.852-05:00Comments on Headius: Advanced Rails Deployment with JRubyCharles Oliver Nutterhttp://www.blogger.com/profile/06400331959739924670noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-20975090.post-71889146903410495682006-12-19T13:30:00.000-06:002006-12-19T13:30:00.000-06:00Hi Charles
I am using the jruby-complete.jar whi...Hi Charles <br /><br />I am using the jruby-complete.jar which is a cool idea. It works great when I use erb or csv in the rb file called from java.<br /><br />However, if I do a require 'test/unit' in the rb file and it was called from java, I am trying to call a rb file not at the top level and get an excpetion. <br /><br />RichAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-20975090.post-46830822482518638072006-11-19T23:07:00.000-06:002006-11-19T23:07:00.000-06:00venkat: Re your additional questions...
1. Yes, m...venkat: Re your additional questions...<br /><br />1. Yes, most likely. However multiple JRuby VMs is a lot more lightweight than multiple Ruby processes.<br />2. The JRuby runtime is pretty simple to respawn; just instantiate a new one. That said, we're hoping some of the long-term execution issues that plague C Ruby won't plague us since the JVM has a more robust garbage collector and memory model.<br />3. It doesn't have to be non-standard; it could certainly be handled by the container, on a per-thread, per-app basis. There's no requirement that it be more cumbersome than setting up a pool of threads or services for any typical Java app.<br /><br />nohmad: Yes, we have a wrapper for jline that works really, really great! It was contributed by Damian Steer. We've also got assurances from the jline author that he'll accept our patches and fixes, so we should have good solid readline support from now on.<br /><br />tony hursh: oh, now THAT is cool. I'm on OS X and I'm all over using something like this to build apps. This is a perfect example of how a self-contained Ruby intepreter can be so very flexible. I'm blogging this :) I hope you'd be willing to contribute it to the jruby-extras project on RubyForge and maybe join the project to maintain and improve it. Thanks so much!Charles Oliver Nutterhttps://www.blogger.com/profile/06400331959739924670noreply@blogger.comtag:blogger.com,1999:blog-20975090.post-83107258839252055072006-11-19T21:17:00.000-06:002006-11-19T21:17:00.000-06:00This is great, Charles! Thanks!
I just put togeth...This is great, Charles! Thanks!<br /><br />I just put together an experimental template for Xcode on the Mac that uses jruby-complete.jar to generate self-contained JRuby applications for OS X. If anyone wants to give it a whirl, you can find it here:<br /><br /><a href="http://teach.alternamatch.com/jruby/">JRuby Xcode template</a><br /><br />This is experimental as all get-out, so caveat coder. :-) <br /><br /> <br />P.S. I think Blogger mangled your "Ruby-in-a-Jar" link above.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-20975090.post-85137301518642918202006-11-19T15:54:00.000-06:002006-11-19T15:54:00.000-06:00Did you write jline wrapper for jruby as in readli...Did you write jline wrapper for jruby as in readline wrapper for ruby? jruby-complete.jar works really nice. However IRB in applet didn't work in my OSX.<br /><br />$ jar -tvf jruby-complete.jar | grep -i applet<br /> 821 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/DOMScriptingApplet$1.class<br /> 1903 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/DOMScriptingApplet.class<br /> 1174 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/IRBApplet$1.class<br /> 2165 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/IRBApplet$2.class<br /> 1346 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/IRBApplet$3.class<br /> 1260 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/IRBApplet$4.class<br /> 723 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/IRBApplet$5.class<br /> 3779 Fri Nov 17 11:50:54 KST 2006 org/jruby/demo/IRBApplet.classnohmadhttps://www.blogger.com/profile/10785581198895974780noreply@blogger.comtag:blogger.com,1999:blog-20975090.post-14555148635153090402006-11-19T01:36:00.000-06:002006-11-19T01:36:00.000-06:00Charles: Thank you very much for your reply. Sorry...Charles: Thank you very much for your reply. Sorry if these a really dumb points. I thank you for your thoughts on these. <br /><br />1. Rails being not thread safe by default, isn't Multi-VM approach the only way to run Rails in the WAR deployment style? <br /><br />2. I agree that not having to launch the heavy process for each run time is a good thing. However, isn't the case that if a JRuby runtime dies it still needs to be restarted manually inside the application code someware as opposed to container doing it with threads and the management flexibility comes with it?<br /><br />3. Isn't it the case that configuring the number of lightweight JRuby VMs needs to be done in a non standard way inside the app as opposed to doing it at the level of container like Tomcat?<br /><br />Thanks,<br />Venkat.venkathttps://www.blogger.com/profile/05458042595403099224noreply@blogger.comtag:blogger.com,1999:blog-20975090.post-14587439860203223892006-11-18T01:30:00.000-06:002006-11-18T01:30:00.000-06:00venkat: There's an absurdly simple solution to thi...venkat: There's an absurdly simple solution to this...<br /><br />Use multiple JRuby runtimes.<br /><br />Because we can share the vast majority of the JVM across JRuby runtime instances, you can emulate the cumbersome and over-heavy multi-process model using JRuby's "multi-VM" support. You need to handle 100 requests at the same time? Easy, 100 JRuby runtimes. All that's duplicated is the top-most layer of the virtual "Ruby machine" under the Rails app, rather than the entire process. Far more scalable and trivial to implement.Charles Oliver Nutterhttps://www.blogger.com/profile/06400331959739924670noreply@blogger.comtag:blogger.com,1999:blog-20975090.post-2978792160145498482006-11-18T00:59:00.000-06:002006-11-18T00:59:00.000-06:00Hello Charles:
I Thank you for all the contributi...Hello Charles:<br /><br />I Thank you for all the contributions to the JRuby. One question I have on the deployment with GlassFish:<br /><br />One benefit of the multi process model is that the developer need not worry about multi threading issues. If my memory is correct, Rails itself is not thread safe. How can such environment be deployed in a multi threaded server? <br /><br />Thanks in advance for your answer,<br />Venkat.venkathttps://www.blogger.com/profile/05458042595403099224noreply@blogger.comtag:blogger.com,1999:blog-20975090.post-18922629641207625882006-11-17T20:56:00.000-06:002006-11-17T20:56:00.000-06:00This is great news -- thank you. I've started bui...This is great news -- thank you. I've started building Spring MVC applications with JRuby implementations with great success... but setting the load path to find Ruby libraries always felt dirty. <br /><br />Being able to run an entire JRuby application from jars lets us go to deployment with a proven method that SysAdmins are comfortable with.Charles Greerhttps://www.blogger.com/profile/12866542841436164930noreply@blogger.comtag:blogger.com,1999:blog-20975090.post-27507688343949534612006-11-17T17:08:00.000-06:002006-11-17T17:08:00.000-06:00Do you have an applet on your blog?
If visit your...Do you have an applet on your blog?<br /><br />If visit your blog java starts up and starts eating 100%cpu and 100%network. I'm on Linux and use the latest jdk1.6.0.<br /><br />Maybe you could look at it. I love to read your blog but I hate to remove the java plugin each time.<br /><br />Kees.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-20975090.post-67774223447432839632006-11-17T14:40:00.000-06:002006-11-17T14:40:00.000-06:00We will likely want to use rule elements in the fu...We will likely want to use rule elements in the future, so I figured I'd just start using jarjar now.Charles Oliver Nutterhttps://www.blogger.com/profile/06400331959739924670noreply@blogger.comtag:blogger.com,1999:blog-20975090.post-76591506314622859622006-11-17T13:24:00.000-06:002006-11-17T13:24:00.000-06:00Hi Charles. I looked at your build.xml and it does...Hi Charles. I looked at your build.xml and it doesn't look like you're using any jarjar "rule" elements. This means that the class files from your dependency jars are just getting stuffed into the jar without any repackaging. If this is what you want then you could just use the normal "jar" task instead of jarjar.Chrishttps://www.blogger.com/profile/18228493382440392130noreply@blogger.com