jruby

wrong # of arguments(0 for 1)

Hello all, Here is my Test model code: require 'rubygems' require 'composite_primary_keys' class VamTest < ActiveRecord::Base set_table_name 'tests' set_primary_keys :service, :host end This is the stacktrace I get when I run the following: >> VamTest.all VamTest.all ArgumentError: wrong # of arguments(0 for 1) from C:/jruby...

Strangeness when deploying JRuby app under Jetty

This problem is maddening and I hope someone can point me in the right direction. I'm trying to deploy an instance of Redmine to a Jetty servlet. I've created the war using Warbler, have created the context, and it seems to deploy. Unfortunately, I see the following behaviors: If I access my app at its configured hostname's /, I see a ...

What do I need to know about JRuby on Rails after developing RoR Apps?

I have done a few projects using Ruby on Rails. I am going to use JRuby on Rails and hosting it on GAE. In that case what are the stuff that I need to know while developing JRuby apps. I read that JRuby has the same syntax I can access Java libraries JRuby does not have access to some gems/plugins JRuby app would take some time to load...

Howto use JRuby's org.jruby.lexer.yacc.RubyYaccLexer

I'm using ripper to doing ruby-code lexing in mri-1.9., I would like to do the same thing in JRuby, i noticed there is this org.jruby.lexer.yacc.RubyYaccLexer used in org.jruby.parser.DefaultRubyParser, i'm thinking that i can use it to do what ripper in mri-1.9. does, though definitely at a lower level as compared to ripper. Being a noo...

Google App Engine with JRuby - can someone provide an overview of appengine-jruby, warble etc?

Hello there! I'm getting myself confused as to how to get a JRuby app cranking on App Engine. I know that you can get started using the appengine-jruby "gem" (Note: I'm a Java programmer, so this is all completely new to me). I've also seen some talk about Warbler, and am getting the impression that I could probably use Warbler someho...

jruby on rails missing mysql-adapter

Hello all, I am deploying a JRuy on Rails app to a Tomcat instance and get the following error when I try to pull up the app in a Web browser: INFO: /!\ FAILSAFE /!\ Wed Sep 01 12:27:30 -0400 2010 Status: 500 Internal Server Error no such file to load -- file:/C:/Tomcat 6.0/webapps/VamWebDashboard/WEB-INF/lib/gems.jar!...

best way to access a parent object from a child object

I am creating a population genetics simulation system in JRuby. I have created classes such as Allele, Gene, Organism, Population. A Population object contains multiple Organism objects (in an array), each Organism object contains multiple Genes, and so on. Currently, it is very easy to know, for example, what Gene objects a certain ...

require jruby seems to work and fail simultaneously

John-Breedloves-Mac-mini:~ john_breedlove$ irb >> require 'jruby' => true >> require 'zxing' RuntimeError: ZXing requires JRuby from /Library/Ruby/Gems/1.8/gems/zxing-0.1.1/lib/zxing.rb:1 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /System/Li...

RoR: Listing of subrecords

Schema: persons (id, name, birthyear, gender) pets (id, person_id, name, leg_count) plants (id, person_id, kind, qty) I would like to make a read-only report about these things grouped by persons. The listing of personns is done (without the associated records). I would like to have "subtables" per persons. Something like: Persons +...

All Ruby interpreters follow the same Ruby syntax?

Do all Ruby interpreters follow the same Ruby syntax defined in www.ruby-lang.org? MRI YARV Rubinius JRuby IronRuby Cause it is the interpreter that defines the Ruby language. Does that mean one interpreter could add a feature/syntatic sugar that other interpreters haven't? If that is the case, do all interpreters have their own API...

java performance within jruby

An algorithm written in Java should be faster than the same algorithm written in JRuby, right?. However, if I write the algorithm in Java and then call it from JRuby, will I still get the performance advantages of java? I ask this because I am writing a very complicated utility class for my JRuby on Rails app and need to choose whether...

Struts vs. [j]Ruby on Rails

I've spent the last 9 months using Ruby on Rails exclusively. I've been asked to join project and they are currently using Struts with Tomcat. I've done Java in the past and vowed never to go back for several reasons. They are currently having trouble finding people who know Java or are willing to join a project that uses it. (This is w...

Java libraries to manage CSS explosion and or reuse?

Java Q: I like CSS for simple web pages but loathe it when it comes to real world sites because you get css explosion and lots of repeating. I am tempted to use Sass and or Compass but they are Ruby programs which will most likely require some interesting Maven + JRuby love to get working for Java Web app dev. This also makes it difficu...

How do I get RubyGems to work with Jruby and JBOSS; works with Tomcat but not JBoss

I have a WAR file that uses jruby-complete.1.5.2.jar to provide JRuby as a ScriptEngine. My JRuby script relies on some Ruby gems that I packaged in a jar file. This works fine when I run the WAR file under Tomcat, but it does NOT work when I use JBoss 5.1.0. To trouble shoot, I even tried running a simple script that required the "ra...

jruby regex different on windows from os x?

i've got a jruby regex that i'm printing in rails: @@private = /somethingthatshouldnevermatch/ def secure? puts "security test(#{action_name}/#{@@private}: #{@@private.match(action_name).nil?.to_s}" action_name =~ @@private end on os x, using WEBRick and jruby, this prints security test(index/(?-mix:somethingthatshouldnevermatch...

security issue running jruby on tomcat6

i deployed a jruby/rails app to tomcat6 through a warbler-built war. system is ubuntu 8, running tomcat6. when i try to start the app, i get the following stack trace Sep 13, 2010 7:57:24 PM org.apache.catalina.core.ApplicationContext log SEVERE: Application Error java.security.AccessControlException: access denied (java.ut...

what could cause an "IOError(closed stream)" in jruby?

i've spent the last three days trying to get a jruby/rails/couchdb app deployed to a linux/tomcat environment. i'm ready to shoot something. my current issue is this - there is a specific gem, "simply_stored", that acts at the top level driver for couchdb. whenever i hit code in the app that touches this gem, i get this ruby trace: IOEr...

Thrift gem and JRuby

I just recently installed JRuby and the Thrift gem after using it in MRI. I'm running into a problem where if I require 'thrift' I get the message "Unable to load thrift_native extension. Defaulting to pure Ruby libraries." If I then try and require the code thrift generated in ruby I'll get this error: "NameError: uninitialized constant...

How can you get a sql script of changes from Rails migrations (for MySQL)?

I've seen http://github.com/muness/migration_sql_generator, but it doesn't work properly with MySQL for certain important operations. Is there any other way we can capture the sql generated during a rails migration? The reason I'm asking is that I cannot run the migrations on the production server since it is maintained by technical sup...

Use Ruby profile to track down slow execution in RSpec

I have a bunch of rspec tests that are taking entirely too long to run. I am trying to figure out where the bottleneck is and the logical place to start is using the standard libraries profile library. Execution is happening with JRuby 1.5.2 in this particular case. Here is the output after embedding the profile library in my spec: % ...