I’ve tried using JRuby with Rails 2.3.8 and Sql Server 2008 and
everything is smooth. But I’m facing some problems with Rails 3.
Here’s an error that I get when I try to find a post by id. However if I
find all the posts, i.e. ‘Post.find.all’ then it still works but
‘Post.find(1)’ generate the following error.
Is activerecord-jdbcmssql-adapter ready for Rails3?
Has anyone been able to use JRuby, Rails3 and Sql Server; any
recommendations?
Thanks
irb(main):003:0> Post.find(1)
RuntimeError: can’t determine table name
from
c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9
.7-java/lib/jdbc_adapter/jdbc_mssql.rb:455:in determine_order_clause' from c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9 .7-java/lib/jdbc_adapter/jdbc_mssql.rb:241:in
add_limit_offset!’
from
c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/arel-1.0.1/lib/arel/engines/s
ql/relations/compiler.rb:50:in build_clauses' from c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/arel-1.0.1/lib/arel/engines/s ql/relations/compiler.rb:26:in
select_sql’
from
c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/arel-1.0.1/lib/arel/algebra/r
elations/relation.rb:42:in to_sql' from c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active _record/relation.rb:64:in
to_a’
from
c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active
_record/relation/finder_methods.rb:333:in find_first' from c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active _record/relation/finder_methods.rb:122:in
first’
from
c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active
_record/relation/finder_methods.rb:291:in find_one' from c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active _record/relation/finder_methods.rb:281:in
find_with_ids’
from
c:/jruby-1.5.2/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active
_record/relation/finder_methods.rb:107:in find' from c:0:in
find’
from (irb):3