jruby

Logging inside threads in a Rails application

I've got a Rails application in which a small number of actions require significant computation time. Rather than going through the complexity of managing these actions as background tasks, I've found that I can split the processing into multiple threads and by using JRuby with a multicore sever, I can ensure that all threads complete in...

Is there anything wrong with having a (custom) getId method on a Java object used in JRuby?

I'm a big fan of concise method names, so when our codebase has something like: Account.getAccountId(); I like to add an alias so that I can just do: Account.getId(); However, I've heard ... murmurs from elsewhere in my company about how this might be problematic, because the getId I define will interfere with a built-in getId that...

Shutdown hook for Rails

Hi all, I'd like to have some cleanup code run when Rails is shutting down - is that possible? My situation is that I have a few threads in the background (I'm using jruby and calling into java) that live for the life of the process and I need to let them know to shut themselves down Thanks! ...

Unable to load jars in a Rails app on Glassfish

Hi all, I have a Rails app that I'm trying to deploy onto Glassfish using the Glassfish gem, but it's unable to load the jar files I've written. I've tried passing the jars' path to jruby explicitly with jruby -I, but no luck. Any tips? Thanks a bunch ...

recommendation for choosing a new web development stack

I work in a medium to small team ( 10 people ) developing and supporting several web enterprise applications. We have a dozen of them built with a house-made framework with asp-classic working against ms-sql server. We are evaluating the migration to a new development stack. We'd like it to be open (free) and simple. I've been look...

Is JRuby a viable alternative to the MRI for Rails development?

Hey peeps. I am a beginner-verging-on-intermediate rails developer that is working hard to improve my skills. I am a little confused about the state of JRuby, and whether it is a viable alternative to switch to from the MRI. Currently I run a Mac at home and edit using textedit (MRI for ruby, terminal for rails commands, etc). At w...

Automatically Refreshing Rails Metal In Development Mode

I am trying to develop a rails metal endpoint using sinatra, but is proving to be a pain because I have to restart the server every time I change the code. I am in Jruby and running from within a larger Java app. Is there an easy way to make this code refresh for every request? ...

JRuby Community Support

We are exercising various technology or framework options to develop our new portal or web-application on elearning. So the favourites on the list are (not in any specific order) 1. Rails 2. J2EE 3. JRuby So wanted inputs on the JRuby community support if we get to choose JRuby framework. Also want to know JRuby advantages. I have gone...

How to setup a self contained project running jetty+sinatra+jruby?

I already installed jruby and gems seems to be installed nicely under jruby's directory so I don't have to worry about that. Now I would like to be able create a sinatra application and run it on top of jetty or some other efficient standalone server? What do you recommend? It would be important for me that the application source can be...

loading JRuby classes from Java by Class.forName

Hello, I have following class in Java code: public class CHRTreeCreator extends IndexCreator { ... } Instead CHRTreeCreator I want to use diffrent implementation which also extends IndexCreator, but I want to code it in JRuby. The problem is, specific implementation of IndexCreator is chosen based on xml config file: <creator>dwe.in...

Cucumber and/or RSpec with pure Java application using JRuby

After doing some stuff in Ruby on Rails with Cucumber, RSpec and Ruby BDD in general, comming back to JUnit in my Java apps feels like incredible pain to me. I just love the convenience that Ruby brings into testing. From what I understand, it should be theoreticaly possible to use Cucumber features, or even RSpec mocking with pure Java...

How to initialize the SQLite3 JDBC driver in JRuby?

How do you access SQLite3 via JDBC without using active record? ...

Ruby parser in Java

The project I'm doing is written in Java and parsers source code files. (Java src up to now). Now I'd like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses Ruby source code. The only thing I have been able to find up to now are Ruby parsers in Ruby (ParseTree and RubyParser...). I could maybe ...

What's the difference between Ruby and JRuby?

Can anyone please provide me in layman's terms the difference between developing a JRuby and a Ruby, Rails application? I use NetBeans as my Ruby on Rails IDE and every-time I create a project is asks me that question - and I don't really get the difference. Are there any pro and cons? ...

Why doesn't JRuby script.rb > out.txt capture Java errors?

JRuby script.rb throws many Java errors. I tried outputting to a text file, but only the output from the script itself is recorded. I need to capture all the errors that happen, as they are very long. How can I do that? ...

ezcrypto not encrypting consistently in JRuby (MRI is fine)

I'm trying to encrypt some data using the Ezcrypto gem in Ruby. Things work perfectly when running under MRI, but I'm getting strange results when running the same code using JRuby. Executing the following should produce the same output with repeated called. Output from MRI: irb(main):007:0> Base64.encode64(EzCrypto::Key.encrypt_with_...

jruby 1.4 webrick logs in rails

I just upgraded jruby to 1.4 and I notice when I run my rails app that I get all kinds of logging spam now. Has anyone had experience with this? I'm not sure if it's a jruby thing, or if they've change the version of Webrick (i can't remember the version being run before) but I have a log line for every static file it loads. The wor...

Error: Your application used more memory than the safety cap of 500m. Specify -J-Xmx####m to increase it (#### = cap size in MB). Specify -w for full OutOfMemoryError stack trace

i was running a jruby something.rb script and suddenly it throws this Error: Your application used more memory than the safety cap of 500m. Specify -J-Xmx####m to increase it (#### = cap size in MB). Specify -w for full OutOfMemoryError stack trace ...

How do I unmarshal a ruby object in java?

I have a an object that I'd like to grab the contents of in java. The only problem is that is is currently in ruby. irb(main):050:0> blah => "BAh7ByIeYXV0aGVudGljYXRpb25fc3RyYXRlZ2llczAiCXVzZXJpBg%253D%253D-\ -0cdecf4edfaa5cbe4693c9fb83b204c1256a54a6" irb(main):049:0> Marshal.load(Base64.decode64(blah)) => {"authentication_strategies"=...

How to register a JDBC driver using jruby-complete.jar?

I'm trying to write a script that is executed with the jruby-complete.jar like so: java -cp derby.jar; -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver -jar jruby-complete.jar -S my_script.rb I'm using JVM 1.6.0_11 and JRuby 1.4. In my jruby script I attempt to connect to the database like this. connection = Java::com.sql.DriverM...