From: Jan Svitok Date: 2006-11-15T00:55:27+09:00 Subject: Re: gem query finds gem, yet require fails On 11/14/06, Michael Glaesemann wrote: > > On Nov 12, 2006, at 23:28 , Michael Glaesemann wrote: > > > > The bindings appeared to install correctly. Using gem query, I can > > see: > > > > > > *** LOCAL GEMS *** > > > > postgres (0.7.1) > > The extension library to access a PostgreSQL database from Ruby. > > > > sources (0.0.1) > > This package provides download sources for remote gem installation > > > > However, when testing with irb to see if the postgres gem can be > > found, I get: > > > > $ which ruby > > /usr/local/bin/ruby > > $ which irb > > /usr/local/bin/irb > > $ irb > > irb(main):001:0> require 'rubygems' > > => true > > irb(main):002:0> require 'postgres' > > LoadError: no such file to load -- postgres > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > custom_require.rb:27:in `gem_original_require' > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > > custom_require.rb:27:in `require' > > from (irb):2 > > > > I'm stumped. On my primary machine, the above two commands work > > just fine in irb. > > Any ideas at all on this? I'm really stuck. Or perhaps how to make > sure I've completely uninstalled Ruby and rubygems so I can maybe try > installing again? > > As an aside, how could I make this message more likely to get a > response? I seem to have lost my knack. > > Thanks for any suggestions on either issue :) > > Michael Glaesemann > grzm seespotcode net Hi, [I don't know anything about neither OSX nor postgres gem] - it seems you have require patched, so gems are in the game. that's fine. - postgres from the listing seems to have compiled extension. Check whether it is indeed compiled - you'll have postgres.so somewhere in the dir. If it's not there look for info how to setup build environment - check whether the ext is directly in lib or somewhere deeper - i.e. require 'whatever/postgres' - go there, try require it from the dir where it is without rubygems if you can't the problem is somewhere deeper. For example, on debian&co you have to have installed build-essential package. Without it, the ext won't be compiled however gem will install fine and don't tell anything.