jrubyonrails

Opposite of rails initializers (2.xx)?

I run several daemons in config/initializers/ when I start my rails app, but I need a way to detect when the app is shutting down, and stop the daemons. Are there any hooks / places where I can do this? ...

Is there a delayed_job like gem for jruby?

I'm trying to convert a rails app to jruby on rails. Currently, jruby script/delayed_job run gives: /usr/lib/jruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:50:in `each_object': ObjectSpace is disabled; each_object will only work with Class, pass -X+O to enable (RuntimeError) from /usr/lib/jruby/lib/ruby/gems/1...

Braces: [Brackets], (Parentheses) & {Curlies} in Ruby & Rails

So the loose tolerance of Ruby to use braces sometimes and not REQUIRE them has led to alot of confusion for me as I'm trying to learn Rails and when/where to use each and why? Sometimes parameters or values are passed as (@user, @comment) and other times they seem to be [ :user => comment ] and still others it's just: :action => 'edit'...

How do Rails and Jruby relate?

Background: I have a java library that is accessed by many developers - usually via java. However, a few devs hope to access this via a Ruby API. I am gravitating in the direction of Jruby in order to implement a Java-Ruby API. Questions: My main concern is that these developers will not be able to utilize the API in their current, R...

Should a Rails app have to work in jRuby, when I want to deploy it via warble on a Java application Server?

I want to make sure, the app will work properly before I "warble" it. Does it have to work in jRuby for that or does it work anyway? ...

How reliable is JRuby?

I'm interested in promoting JRuby in our office as the platform hosting Rails applications. But how reliable is it? Is its performance better than MRI 1.8.7? JRuby 1.5 states that it is 100% compatible with Ruby 1.8.7, does this mean that JRuby can run any Ruby/Rails code? ...

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...

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...

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!...

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...

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...

Compile a jruby on rails application to a jar?

Is there a quick way to pack a jruby on rails application into a jar? Is there an ec2 on rails like virtual appliance for jruby on rails apps? ...

JRuby on Rails app on and JBoss 4.2.0/Tomcat 5.5

My JRuby on rails app works fine on Tomcat 6.0, But when I deploy it on my company's webfarm which is JBoss 4.2.0/Tomcat 5.5 (Servlet API 2.4) It fails with the following stack trace: java.lang.ArrayIndexOutOfBoundsException: 0 at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateBufferInvocation(AsmLibraryLoader.java:548) at com....

jRuby and Problems with Warbler, RVM, and Tomcat

I've been having a tough time getting jRuby on Rails 3 deployed on Tomcat 6. I got it to work exactly once. I modified my database.yaml and Gemfile to check for jRuby, something like this: if defined?(JRUBY_VERSION) gem 'jdbc-mysql' #gem 'jdbc-sqlite3' gem 'activerecord-jdbc-adapter' gem 'activerecord-jdbcmysql-adapter'...

JRuby on Rails: Using custom Java classes in your Rails app

I just started with JRuby on Rails and absolutely love it. I know how to use current classes within the Java API in my Rails app, but if I wanted to create a new custom class written in purely Java code, how would I be able to use it in my Rails app? For example, let's say I created Dog.java: class Dog { private String name; publi...

JRoR: How to share memory between requests and sessions with a singleton?

For a RoR web project I am building the component stack. Because I want to share some cached business objects between requests and sessions of the same application I planned not to use the Rails/Mongrel shared nothing principle and switch over to JRuby for the first time. (No, I do not want an extra process like memcached). My idea so fa...

jRuby Glassfish v3 dispatcher error

hi all. i have ubuntu 8.10, running glassfish v3 (not prelude). first deployment of any jruby on a glassfish v3 SERVER (not the gem). i have deployed the app using the 'choose folder' method, rather than the asadmin deploy method, though i have also tried that. i get the following error message: #|2010-10-18T16:48:01.643+1100|SEVERE...

Tomcat possible way that don't load TOMCAT JAR from JAXB before my Web Application built in JRUBY

I get this error on my application when i try to run in "Tomcat", in WEBrick works fine: SEVERE: Application Error org.jruby.rack.RackInitializationException: wrong # of arguments(0 for 1) from /home/gpereira/apache/apache-tomcat-6.0.18/webapps/vtsbackoffice/WEB-INF/app/controllers/application_controller.rb:5 and in line 5 i h...

Ruby on Rails (JRuby) errors custom error pages (500) not being properly captured

Hello All: Wondering if anyone has come across this issue before, I am using JRuby v 1.5.x and Rails 2.5.x on a Tomcat Server and I am having difficulty capturing an error and redirecting to a 500.html page. Here is a stacktrace. I attempt to capture the error state but to no avail, it goes immediately to rendering the web page. (Att...

jruby multipart post fails for files larger than 800k or so

I have a jruby application deployed using glassfish-gem with an apache front end. When I do a form post of a file it fails on files over a certian size, seems to be around 800k. The error is below if it helps any. glassfish.yml is generated, no changes from default other than to increase some java memory settings. I have bypassed apa...