2
votes

I am using jruby 1.5.2 as my production env and I am trying to move my dependency management from gem_tools to 'bundler'.

Once I checkout the code on the server and run a 'bundle install' it errors out with the following: Could not find gem 'json-jruby (~> 1.5.0) ruby' in any of the gem sources listed in your Gemfile

I also, tried jruby -S gem install json-jruby and then tried the :path option in the Gemfile after which I got the following error:

Could not find gem 'json-jruby (>= 0) java' in source at /usr/local/jruby-1.5.2/lib/ruby/gems/1.8/gems/json-jruby-1.5.0-java. Source does not contain any versions of 'json-jruby (>= 0) java'

Any thoughts around the fix for this issue would be greatly appreciated. I am hoping a lot people must have this issue like me.

Below are some env details: jruby 1.5.2 (ruby 1.8.7 patchlevel 249) (2010-08-20 1c5e29d) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_30) [amd64-java] rails 2.2.2

Gemfile:

....
....
platforms :jruby do
  gem 'activerecord-jdbc-adapter', '0.9.4'
  gem 'activerecord-jdbcmysql-adapter', '0.9.4'
  gem "json-jruby", "~> 1.5.0"
  gem 'image_voodoo', '0.7'
  gem 'jdbc-mysql', '5.0.4'
  gem 'jruby-openssl', '0.2.3'
end 
....
....
group :integration, :devwithcaching, :production do
  if defined?(JRUBY_VERSION)
    gem "json-jruby", "~> 1.5.0"
  else
    gem 'json_pure', '1.6.5'
  end
end
2
what happens when you try gem install jsonFrancois
that gem directory is empty toouser380692

2 Answers

0
votes

So this is an old one but the answer my still be relevant on recent JRuby as well :

It's best to use simply the json gem which provides C ext on MRI and a -java version on JRuby for optimal performance (since version 1.5.0 ~ 01/2011) thus simply :

ruby gem 'json', '>= 1.5.0' do not wrap it in a platforms :jruby block (of even worse use defined? JRUBY_VERSION in a Gemfile).

NOTE: the json-jruby gem seems to have stopped spitting releases around the same time (01/2011) as the json gem started shipping a -java version of the gem, thus if there are issues with it on JRuby and it's not likely to get them fixed so it's best avoided.

0
votes

This json-jruby version doesn't exist. Looks like the json-jruby's documentation is wrong as well http://rubygems.org/gems/json-jruby

Try to replace the version for 1.5.0-java instead of 1.5.0.