Hi, I have developed an application using ROR. For one feature, now I have to use JRuby. I have installed JRuby in my system. I included the follwing statement in my controller. include Java I got the following error. "uninitialized constant Java (NameError)" This is because the file is executes using "ruby" command. But when I run the file as a stand-alone program using "jruby" command, it executed successfully. But it is not working with my application. Can i force the interpreter to use "jruby" command only for this file? Is there any way to solve this issue? Thanks in advance... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 9 Apr 2008, at 08:08, Karthi kn wrote:> > Hi, > > I have developed an application using ROR. For one feature, now I have > to use JRuby. I have installed JRuby in my system. > > I included the follwing statement in my controller. > > include Java > > I got the following error. > > "uninitialized constant Java (NameError)" > > This is because the file is executes using "ruby" command. But when I > run the file as a stand-alone program using "jruby" command, it > executed > successfully. But it is not working with my application. > > Can i force the interpreter to use "jruby" command only for this file?Can you just run the whole app using jruby? Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I am not sure. I have just started exploring on JRuby. I installed jruby and added the needed code in my controller and tried to run the application normally. That is an application created with ruby but not jruby. Can we run the appilcation using jruby? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 9 Apr 2008, at 08:24, Karthi kn wrote:> > I am not sure. I have just started exploring on JRuby. I installed > jruby > and added the needed code in my controller and tried to run the > application normally. > > That is an application created with ruby but not jruby. > > Can we run the appilcation using jruby?jruby''s certainly aims to be able to do anything the ruby can (but just happens to run on the jvm). Unless you''ve got lots of ruby extensions (which contain c code and so do require work to be ported to jruby) it''s certainly worth a go. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
My application is a big one. It''s almost completed. Now my requirement is to create crystal report from my application by passing my query results as XML to the crystal report template. For this Crystal Report implementation, there is no API in ROR. But API is available for Java-CrystalReport integration. So I planned to use the JRuby to utilize the Java libraries. But now, I think, it is not possible to do that in my application because I have created my whole application using Ruby but not JRuby. What is your opinion on this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 9 Apr 2008, at 09:22, Karthi kn wrote:> > My application is a big one. It''s almost completed. Now my requirement > is to create crystal report from my application by passing my query > results as XML to the crystal report template. > > For this Crystal Report implementation, there is no API in ROR. But > API > is available for Java-CrystalReport integration. So I planned to use > the > JRuby to utilize the Java libraries. > > But now, I think, it is not possible to do that in my application > because I have created my whole application using Ruby but not JRuby. >I''m by no means a jruby expert (I''ve read about it, but haven''t used it properly, just for tinkering), but in theory it is just another version of ruby and should be able to run your app just as well as the standard MRI ruby. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for your thoughts Fred.. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, For those options that are JRuby specific, you could add a conditional in your code, like: if RUBY_PLATFORM =~ /java/ # jruby-specific code here end As for some of your other questions. Typically, jruby behaves as just a ruby replacement, and in most cases that''s all you need to do -- to invoke jruby instead of ruby. (There are cases, like native C extensions, are not supported by JRuby). Well, in case of Rails, you''d also need to adjust your database config to specify proper adapter. JRuby works great with either webrick or mongrel. There is much more info on "JRuby on Rails" on JRuby wiki (which is unfortunately down at the moment ;) ): http://wiki.jruby.org/ But I have my own "120 seconds guide to JRuby on Rails" here: http://blog.emptyway.com/2008/04/08/120-seconds-guide-to-jruby-on-rails/ Thanks, --Vladimir --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You probably need to use JRuby for the whole stack. Whatever is executing your server needs to be run by jruby, not ruby. Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 09/04/2008, at 5:08 PM, Karthi kn wrote:> > Hi, > > I have developed an application using ROR. For one feature, now I have > to use JRuby. I have installed JRuby in my system. > > I included the follwing statement in my controller. > > include Java > > I got the following error. > > "uninitialized constant Java (NameError)" > > This is because the file is executes using "ruby" command. But when I > run the file as a stand-alone program using "jruby" command, it > executed > successfully. But it is not working with my application. > > Can i force the interpreter to use "jruby" command only for this file? > > Is there any way to solve this issue? > > > Thanks in advance... > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---