Ruby Forum JRuby > Invalid char `\270' ('�') in expression

Posted by Sharkie Landshark (sharkie)
on 13.08.2008 17:54
I am getting the very strange error below off my code that I do not get
when I use regular ruby (MRI). I am on Leopard and using Java 1.5.

/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1907:
Invalid char `\270' ('�') in expression

/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1907:in
`class_eval'
/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1907:in
`compute_type'
/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1428:in
`instantiate'
/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:582:in
`find_by_sql'
/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:582:in
`collect!'
/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:582:in
`find_by_sql'
/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1341:in
`find_every'
/usr/local/jruby-1.1.3/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:536:in
`find'
app/controllers/stories_controller.rb:41:in `index'
:1:in `start'


My code around those lines look very normal:

@stories = Story.find :all,
          :conditions => "entries.status = 1 AND entries.score > 2",
          :order => "entries.created_at DESC",
          :limit => @story_pages.items_per_page,
          :offset => @story_pages.current.offset,
          :include => [ :user ]

Can someone please help? I would really like Jruby to work out for me.