Db2_connect on ruby 1.8.5 rubygems 1.3.5

Hi,

I have a red hat server with Ruby 1.8.5 and RubyGems 1.3.5 and are
trying to get ruby connected to a IBM DB2 database. My intention was to
use ibm_db from ruby gems, but that didn’t work

$ gem install ibm_db
ERROR: Error installing ibm_db:
multi_json requires RubyGems version >= 1.3.6

From what I can see the latest version of RubyGems for Ruby 1.8.5 is
1.3.5. So is the only way for getting ruby connected to db2 to upgrade
to a newer version of Ruby? Or is there a different tool I can use for
connection to at IBM DB2 database using Ruby 1.8.5?

/Emil

IMHO upgrading to a more current Ruby is your best bet

However, if that’s not possible you could specify an older version of
the ibm_db gem that aligns with the version of Ruby you have
Looks like Ruby 1.8.5 was last updated in 2008, so maybe ibm_db 0.9.3

  • 1.0.1 will work

cheers
Chris

On Fri, Jul 27, 2012 at 11:18:48PM +0900, Emil Enem

It is probably still trying to install the latest version of
multi_json. Install it “alone” first in your chosen version, then
ibm_db shouldn’t complain when it sees it already installed.

– Matma R.

I know it would be best to upgrade to latest version of Ruby, but since
the scripts is planed to be running on multiple server it would be
easier to go get it working with the current version of Ruby.

I tried installing an older version of ibm_db but it keeps trying to
install multi_json for dependency, is there a way to give a no
dependency for gem install? Since multi_json requires Rubygems 1.3.6 and
ruby 1.8.5 is only working with Rubygems 1.3.5 I can’t install it.

From where is the dependency defined? Both my version of Rubygems and
ibm_db are older than the oldest version of multi_json, so Im a bit
mystified on where the the dependency is coming from?

/Emil

I tried that as well, but all the version og multi_json I have found
requires RubyGems version 1.3.6 and I cannot upgrade to that version of
Rubygems unless I upgrade Ruby.

/Emil

Well, if you’re really desperate, you can try to fix up multi_json
yourself to work with older Rubies.

Start with gem fetch multi_json, this will download a .gem file that
is actually a TAR archive. Untar it, there are two .gz archives inside
– one for the metadata (you can change the required version number
there), one ofr the data (the actual code, gemspec (where you also
need to change the version) and stuff).

Once you’re done, tar it again and run gem install multi_json --local in the directory where the modified .gem file is.

But really, you should upgrade. 1.8.5 is old as balls and if
multi_json requires newer version, it might actually use some features
unavailable on 1.8.5.

– Matma R.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs