librelist archives

« back to archive

JRuby + json gem woes

JRuby + json gem woes

From:
Tony Arcieri
Date:
2010-06-17 @ 17:14
It appears the latest versions of the resque gem directly depend on the
"json" gem.  The problem with this is the json gem requires a C extension
and won't install on JRuby.

There is a json-jruby gem which functions as a drop-in replacement.  For the
time being I've hacked its gemspec and published a -java platform gem named
"json".

Ideally whoever publishes the json gem should also publish a -java version
of it on rubygems.org, but right now that's not the case.

So I have no idea what a "good" solution to this problem is.  For now I'm
comfortable with my band-aid approach.

-- 
Tony Arcieri
Medioh! A Kudelski Brand

Re: [resque] JRuby + json gem woes

From:
David Balatero
Date:
2010-06-17 @ 17:19
I think the best solution is to get in contact with the json gem folks and
push for an official java release. There are a bunch of libraries that rely
on the json gem, so it's in everyone's interest (not just Resque's) to get a
java release out there.

On Thu, Jun 17, 2010 at 10:14 AM, Tony Arcieri <tony.arcieri@medioh.com>wrote:

> It appears the latest versions of the resque gem directly depend on the
> "json" gem.  The problem with this is the json gem requires a C extension
> and won't install on JRuby.
>
> There is a json-jruby gem which functions as a drop-in replacement.  For
> the time being I've hacked its gemspec and published a -java platform gem
> named "json".
>
> Ideally whoever publishes the json gem should also publish a -java version
> of it on rubygems.org, but right now that's not the case.
>
> So I have no idea what a "good" solution to this problem is.  For now I'm
> comfortable with my band-aid approach.
>
> --
> Tony Arcieri
> Medioh! A Kudelski Brand
>

Re: [resque] JRuby + json gem woes

From:
Tony Arcieri
Date:
2010-06-17 @ 17:43
I just emailed Florian Frank (who maintains the "json" gem) and Daniel Luz
(who maintains the "json-jruby" gem) about getting a "json" gem for the Java
platform version of the "json" gem released.

Until then, if anyone else is trying to run Resque under JRuby, you can
publish this version of the json gem on your internal gem server:

http://fails.org/json-1.4.3-universal-java-1.6.gem

On Thu, Jun 17, 2010 at 11:19 AM, David Balatero <dbalatero@gmail.com>wrote:

> I think the best solution is to get in contact with the json gem folks and
> push for an official java release. There are a bunch of libraries that rely
> on the json gem, so it's in everyone's interest (not just Resque's) to get a
> java release out there.
>
>
> On Thu, Jun 17, 2010 at 10:14 AM, Tony Arcieri <tony.arcieri@medioh.com>wrote:
>
>> It appears the latest versions of the resque gem directly depend on the
>> "json" gem.  The problem with this is the json gem requires a C extension
>> and won't install on JRuby.
>>
>> There is a json-jruby gem which functions as a drop-in replacement.  For
>> the time being I've hacked its gemspec and published a -java platform gem
>> named "json".
>>
>> Ideally whoever publishes the json gem should also publish a -java version
>> of it on rubygems.org, but right now that's not the case.
>>
>> So I have no idea what a "good" solution to this problem is.  For now I'm
>> comfortable with my band-aid approach.
>>
>> --
>> Tony Arcieri
>> Medioh! A Kudelski Brand
>>
>
>


-- 
Tony Arcieri
Medioh! A Kudelski Brand

Re: [resque] JRuby + json gem woes

From:
Thibaut Barrère
Date:
2010-06-17 @ 18:46
> Until then, if anyone else is trying to run Resque under JRuby, you can
publish this
> version of the json gem on your internal gem server:

In case it's useful to someone else, here I'm using json_pure-1.2.1
(pure-ruby version) with my JRuby resque setup, unpacked under a folder. It
appears to work instead of json, and performance doesn't seem to be bad on
my setup (it's not a high volume system thought :-).

hth,

-- Thibaut

Re: [resque] JRuby + json gem woes

From:
Tony Arcieri
Date:
2010-06-25 @ 00:32
So the guy who maintains the "json" gem apparently doesn't respond... at
least to people who ask JRuby-related questions about the json gem.

Was there some reason "json" was selected over yajl?  I know Resque at least
used to be configured to try to pull in yajl first, then fall back on json.

If there's no blocking issues on pulling in "yajl" instead of "json", maybe
I could talk to the yajl folks about getting a yajl gem published for JRuby.

-- 
Tony Arcieri
Medioh! A Kudelski Brand

Re: [resque] JRuby + json gem woes

From:
Tony Arcieri
Date:
2010-08-11 @ 23:22
So I see Resque 1.9.9 switched from the "json" gem to the "json_pure" gem.

In the meantime, the issues surrounding the "json" gem have been resolved.
 The "json" gem will now work on MRI/YARV, JRuby, and Rubinius.

Perhaps it would be good to switch back to just "json" now?

-- 
Tony Arcieri
Medioh! A Kudelski Brand

Re: [resque] JRuby + json gem woes

From:
Chris Wanstrath
Date:
2010-08-12 @ 08:43
Cool. Can you open an Issue? Thanks!

On Aug 11, 2010, at 4:22 PM, Tony Arcieri <tony.arcieri@medioh.com> wrote:

> So I see Resque 1.9.9 switched from the "json" gem to the "json_pure" gem.
> 
> In the meantime, the issues surrounding the "json" gem have been 
resolved.  The "json" gem will now work on MRI/YARV, JRuby, and Rubinius.
> 
> Perhaps it would be good to switch back to just "json" now?
> 
> -- 
> Tony Arcieri
> Medioh! A Kudelski Brand

Re: [resque] JRuby + json gem woes

From:
Tony Arcieri
Date:
2010-08-12 @ 22:23
Done:

http://github.com/defunkt/resque/issues/issue/135

On Thu, Aug 12, 2010 at 2:43 AM, Chris Wanstrath <chris@ozmm.org> wrote:

> Cool. Can you open an Issue? Thanks!
>
> On Aug 11, 2010, at 4:22 PM, Tony Arcieri <tony.arcieri@medioh.com> wrote:
>
> > So I see Resque 1.9.9 switched from the "json" gem to the "json_pure"
> gem.
> >
> > In the meantime, the issues surrounding the "json" gem have been
> resolved.  The "json" gem will now work on MRI/YARV, JRuby, and Rubinius.
> >
> > Perhaps it would be good to switch back to just "json" now?
> >
> > --
> > Tony Arcieri
> > Medioh! A Kudelski Brand
>



-- 
Tony Arcieri
Medioh! A Kudelski Brand