News for hackers. Stuff that matters.
Re:JRuby 9000 released by aurochs on Wednesday July 22, 2015 @02:16PM (#9931333)
JRuby is a great idea.

It has one pitfall which consistently stops me from using it though : poor support with newer releases of Rails, usually due to the Active Record stack not working well with the AR JDBC adapter.

I know some work was being done on a JRuby version of the standard pg gem (without the need for JDBC) which would be fantastic if it was completed and working.

Re:JRuby 9000 released by headius on Wednesday July 22, 2015 @05:52PM (#9932594)
This is really an unfortunte side effect of every Rails AR adapter being a one-off piece of code. In JRuby, there's not much code different between the databases, but in Rails they're all completely different. That means we basically have to emulate N different codebases just to be compatible. If they settled on a common database layer, our job would be done. Write your congressman.
Re:JRuby 9000 released by yxhuvud on Thursday July 23, 2015 @04:46AM (#9934633)
Coyld an alternative be to simply add a single jdbc adapter to rails instead of pretending to have a lot of different interfaces in parallel?
Re:JRuby 9000 released by nirvdrum on Wednesday July 22, 2015 @09:26PM (#9933443)
If you're open to alternatives, I highly recommend using Sequel. It integrates fairly well with Rails, optimizes extremely well on JRuby, has a consistent update schedule, and has a real API for developing plugins against. I realize it's not part of the standard Rails stack, but it actually makes upgrading Rails easier because you're not constantly chasing a non-standard API that changes release to release (even on MRI, ActiveRecord "plugins" break with almost every release).

Disclaimer: I now work on JRuby full time. But prior to this I ran Mogotest and switched to Sequel successfully on that project.

Re:JRuby 9000 released by fny on Wednesday July 22, 2015 @02:54PM (#9931560)
As far as I'm aware, the port of pg 0.17.1 is alive and well: https://github.com/headius/jruby-pg
Re:JRuby 9000 released by ghufran_syed on Wednesday July 22, 2015 @04:14PM (#9932005)
Is there any guidance out there about when to use activerecord-jdbc-adapter vs this gem (for postgres)?
Re:JRuby 9000 released by headius on Wednesday July 22, 2015 @05:47PM (#9932556)
In general everything ActiveRecord does should be supported by JDBC. The pg port is for cases where you need features the JDBC driver does not support but the C driver does, like geocoding etc.
Re:JRuby 9000 released by astrodust on Wednesday July 22, 2015 @02:37PM (#9931454)
Define "newer" and define "poor"? The JRuby team has done a fantastic job of keeping things working. Do you have any specific problems other than vague grumblings?

Anyone married to the MRI ecosystem because of dependencies on modules with no JVM equivalent may have problems, but new projects usually have no such issues.

Re:JRuby 9000 released by aurochs on Wednesday July 22, 2015 @03:15PM (#9931688)
Rails 4.2 was released 7 months ago.

When I last experimented with creating a standard Rails 4.2 app with the AR JDBC adapter and a database model a few weeks ago, it still didn't work. I haven't looked at things since then.

The workaround some people will suggest is "replace ActiveRecord with Sequel" but for existing projects a migration to a less standard Rails stack may not be viable.

I agree the JRuby team is doing a great job - however Rails is a big use case for any Ruby implementation, so my comment was not intended as a criticism, more in the line of a bug report and something it would be nice to have working now the new JRuby release is out the door.

Re:JRuby 9000 released by exelius on Wednesday July 22, 2015 @03:57PM (#9931895)
Yeah; but at the same time when you're building and scaling an app you run into all sorts of issues like this. JRuby is almost a platform of its own: you get the scalability and benefits of the JVM with the flexibility of Ruby. IMO it's a decision you make pretty early in the product lifecycle. If you're already on Rails, there are other solutions that give you many of the same benefits with an easier migration path (i.e. app containers like Docker).
Re:JRuby 9000 released by amalag on Wednesday July 22, 2015 @02:50PM (#9931535)
I don't want to complain because it is a free product. But there is no doubt a big lag with activerecord. Rails 4.2 is still not supported: https://github.com/jruby/activerecord-jdbc-adapter/issues/59...
Re:JRuby 9000 released by juliangregorian on Wednesday July 22, 2015 @03:11PM (#9931670)
Currently, there's $1700 in store for whoever does support it: https://www.bountysource.com/issues/5831191-tasks-to-finish-...
Re:JRuby 9000 released by ch4s3 on Wednesday July 22, 2015 @04:20PM (#9932044)
Yep, I've put up money for it myself, and regularly be on twitter for other folks to do the same. I wish a big company that uses jRuby would step up and support the tools they use :/
Re:JRuby 9000 released by headius on Wednesday July 22, 2015 @05:51PM (#9932578)
Agreed.
Re:JRuby 9000 released by ch4s3 on Wednesday July 22, 2015 @08:44PM (#9933308)
Know anyone? ;)
Re:JRuby 9000 released by codeodor on Friday July 24, 2015 @09:21AM (#9941759)
I've used JRuby on a Rails 4.2 project and everything turned out fine on it. Many projects may not use what's not yet supported.