# Problem with rubygems (and postgres)

**URL:** <https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958>\
**Category:** Ruby\
**Created:** [July 3, 2006, 7:52pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958 "2006-07-03T19:52:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 7:52pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/1 "2006-07-03T19:52:28Z")

</div>

Hi,

I’ve got Ruby 1.8.4 compiled and installed on a Ubuntu box. I  
installed rubygems 0.8.11. I then installed the postgres gem.  
Everything went ok. Doing a “gem list postgres” shows the postgres  
gem.

So, when I fire up irb and do

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:21:in  
`require__' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`require’  
from (irb):2

That’s not good. Why???!

Thanks,  
Joe

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 7:55pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/2 "2006-07-03T19:55:39Z")

</div>

On Tue, 4 Jul 2006, Joe Van D. wrote:

> =\> true
> 
> That’s not good. Why???!
> 
> Thanks,  
> Joe

do you have two instances of ruby installed? perhaps /usr/bin/ruby and  
/usr/local/bin/ruby?

if so you probably also have

/usr/bin/gem

but only

/usr/local/bin/irb

regards.

-a

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 8:05pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/3 "2006-07-03T20:05:10Z")

</div>

On 7/3/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ```
> > from (irb):2
> > 
> > ```
> 
> if so you probably also have
> 
> /usr/bin/gem
> 
> but only
> 
> /usr/local/bin/irb

I did have the Ubuntu-installed Ruby installed at one point, but I  
removed it. I thought I had removed all traces of it. Maybe not.  
/usr/bin/ruby, /usr/bin/gem, and /usr/lib/ruby don’t exist.

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 9:11pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/4 "2006-07-03T21:11:34Z")

</div>

On 7/3/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > So, when I fire up irb and do  
> > > `require’
> 
> /usr/bin/ruby, /usr/bin/gem, and /usr/lib/ruby don’t exist.  
> For some reason, downloading ruby-postgres-20060406.tar.gz and doing a  
> manual install worked, while installing with the gem did not.

Now, I’ve got to figure out why I’m getting:

/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require': no such file to load -- test/rails (MissingSourceFile) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
from  
/home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:147:in  
`require’  
from ./test/integration/…/test\_helper.rb:4  
from ./test/integration/layout\_test.rb:1  
from  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb:5  
from  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb:5  
rake aborted!

Whenever I try to run any unit tests…

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 4, 2006, 1:10am UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/5 "2006-07-04T01:10:53Z")

</div>

On Tue, 4 Jul 2006, Joe Van D. wrote:

> For some reason, downloading ruby-postgres-20060406.tar.gz and doing a  
> manual install worked, while installing with the gem did not.

oh yeah. i remember that i had the same problem - the compilation stage  
of  
the gem install doesn’t correctly configur the include and lib dirs and  
thus  
is fails (silently).

fyi for people reading this…

-a

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 4, 2006, 1:53am UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/6 "2006-07-04T01:53:57Z")

</div>

On Jul 3, 2006, at 12:10 PM, Joe Van D. wrote:

> dependencies.rb:147:in  
> Whenever I try to run any unit tests…  
> test/rails comes from ZenTest.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 4, 2006, 3:38am UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/7 "2006-07-04T03:38:53Z")

</div>

just a fyi, but i had the same issue hours ago on a fedora box and got  
it  
working using

gem install postgres – --with-pgsql-dir=/usr/local/pgsql

(extra – is correct),then manually making it…

cd /usr/local/lib/ruby/gems/1.8/gems/postgres-0.7.1/  
ruby extconf.rb   
–with-pgsql-include-dir=/usr/local/pgsql/include   
–with-pgsql-lib-dir=/usr/local/pgsql/lib

obvious path changes as req., sorry 'bout the breaks  
(info found @  
[http://www.nostalgix.org/blog/2005/06/hack-lot-ruby-on-rails-tiger-and.html](http://www.nostalgix.org/blog/2005/06/hack-lot-ruby-on-rails-tiger-and.html))

might have been easier using the tarball… 😛

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 4, 2006, 4:21am UTC](https://www.ruby-forum.com/t/problem-with-rubygems-and-postgres/96958/8 "2006-07-04T04:21:40Z")

</div>

sorry, must be sleeping - final step is to

make install
