# Rails 1.2 isn't detecting the PostgreSQL 8.3 adapter (ruby-pg)

**URL:** <https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905>\
**Category:** Rails\
**Created:** [October 27, 2008, 7:08pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905 "2008-10-27T19:08:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Post date:** [October 27, 2008, 7:08pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905/1 "2008-10-27T19:08:13Z")

</div>

Hi everyone.

When I run the rake db:migrate instruction, I get the following error  
(with --trace):

(in /home/jescajadillo/aptana/workspace/amazing)  
\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
rake aborted!  
no such file to load – postgres  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/  
active\_support/dependencies.rb:495:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ active_support/dependencies.rb:342:in`new\_constants\_in’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/  
active\_support/dependencies.rb:495:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ active_support/core_ext/kernel/requires.rb:7:in`require\_library\_or\_gem’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/  
active\_support/core\_ext/kernel/reporting.rb:11:in `silence_warnings' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/ active_support/core_ext/kernel/requires.rb:5:in`require\_library\_or\_gem’  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/connection\_adapters/postgresql\_adapter.rb:7:in  
`postgresql_connection' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 262:in`send’  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/connection\_adapters/abstract/connection\_specification.rb:  
262:in `connection_without_query_cache=' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/ active_record/query_cache.rb:54:in`connection=’  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/connection\_adapters/abstract/connection\_specification.rb:  
230:in `retrieve_connection' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 78:in`connection’  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/migration.rb:284:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/tasks/databases.rake: 4 /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:621:in`call’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:621:in  
`execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:616:in`each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:616:in  
`execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:582:in`invoke\_with\_call\_chain’  
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:575:in`invoke\_with\_call\_chain’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:568:in  
`invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2031:in`invoke\_task’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in  
`top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in`each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in  
`top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2048:in`standard\_exception\_handling’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2003:in  
`top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:1982:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2048:in  
`standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:1979:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/bin/rake:31  
/usr/local/bin/rake:19:in `load’  
/usr/local/bin/rake:19

This is weird because I have the ruby-pg gem and I have no problem  
with Rails 2.1. I get this error with the previous version of Rails,  
1.2. It’s not working here. What’s going on?

My project has PostgreSQL 8.3 database and I want to make it work. Can  
you please help me?

Later…

The N…

---

<div class="post-metadata">

**Author:** ![The\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Post date:** [October 27, 2008, 7:24pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905/2 "2008-10-27T19:24:28Z")

</div>

Hi Neurochild,

> This is weird because I have the ruby-pg gem and I have no problem  
> with Rails 2.1. I get this error with the previous version of Rails,  
> 1.2. It’s not working here. What’s going on?

Rails 1.2 doesn’t support the newer ruby-pg gem. Use the postgres gem  
instead.

–  
Roderick van Domburg

> **[De domeinnaam Nedforce.nl is te koop.](http://www.nedforce.nl)**
>
> Deze mooie domeinnaam kan al over een paar minuten van jou zijn. Betalen gaat eenvoudig en vertrouwd via iDEAL. Direct na de betaling ontvang je de verhuiscode per e-mail en kun je aan de slag.

---

<div class="post-metadata">

**Author:** ![The\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Post date:** [October 27, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905/3 "2008-10-27T19:44:39Z")

</div>

It’s requring an older postgres gem that was just called postgres.

Sent from my iPhone

---

<div class="post-metadata">

**Author:** ![The\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Post date:** [October 27, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905/4 "2008-10-27T21:45:25Z")

</div>

With Rails 2.1.1 I have the same problem, it can’t find it with  
config.gem, however connection to the DB when the gem is installed works  
perfectly.

---

<div class="post-metadata">

**Author:** ![The\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Post date:** [October 27, 2008, 7:49pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905/5 "2008-10-27T19:49:57Z")

</div>

Yeah, right! I discovered shortly after installing the postgres gem.  
(I downloaded the one from the ruby-pg project website which has  
PostgreSQL 8.3 support). The migration worked perfectly.

I believe I’ll stop updating software. XD

Thank you guys.

The N.

---

<div class="post-metadata">

**Author:** ![The\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Post date:** [October 28, 2008, 2:21pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905/6 "2008-10-28T14:21:00Z")

</div>

You are right! There is something wrong with the gems and their  
versions.

From the official website: [http://rubyforge.org/projects/ruby-pg/](http://rubyforge.org/projects/ruby-pg/)

I see:

ruby-pg → ruby-pg-0.7.9.2008.10.13 October 14, 2008  
ruby-postgres → postgres-0.7.9.2008.01.28 January 28, 2008

Therefore I installed the gem ruby-pg, but look at my “gem list” output:

ruby-pg (0.7.9.2008.01.28)

This is wrong!

Installing “sudo gem install pg” fixed the version problem, and now  
Rails 2.1.2 can detect the gem with gem.config

Everything works 100% perfectly.

---

<div class="post-metadata">

**Author:** ![The\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@The\_N](https://www.ruby-forum.com/u/The_N)\
**Post date:** [October 27, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/rails-1-2-isnt-detecting-the-postgresql-8-3-adapter-ruby-pg/151905/7 "2008-10-27T23:12:32Z")

</div>

Hi Fernando,

> With Rails 2.1.1 I have the same problem, it can’t find it with  
> config.gem, however connection to the DB when the gem is installed works  
> perfectly.

Have you also tried the “pg” gem? I believe that’s the preferred way of  
installing the gem from the ruby-pg project. (Yeah, it’s confusing.) pg  
is at version 0.7.9.2008.10.13 and ruby-pg is at 0.7.9.2008.01.28.

If that fails, ensure that you’ve got the latest version of RubyGems. I  
believe 1.3.0 is where it’s at. Finally, check the file permissions on  
the gem directory. Everything contained therein should generally be  
world-readable and the .so files should be world-executable too.

–  
Roderick van Domburg

> **[De domeinnaam Nedforce.nl is te koop.](http://www.nedforce.nl)**
>
> Deze mooie domeinnaam kan al over een paar minuten van jou zijn. Betalen gaat eenvoudig en vertrouwd via iDEAL. Direct na de betaling ontvang je de verhuiscode per e-mail en kun je aan de slag.
