# No such file to load -- postgres (newbie)

**URL:** <https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317>\
**Category:** Rails\
**Created:** [December 6, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317 "2007-12-06T16:13:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![statictony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@statictony](https://www.ruby-forum.com/u/statictony)\
**Post date:** [December 6, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317/1 "2007-12-06T16:13:01Z")

</div>

Ok,

Completely new to Rails here and have just started running through some  
tutorials using

Netbeans 6  
Postgres 8.3 beta  
Windows Vista

I’m looking at migration and trying to get my head round that, but each  
time I run a migration I get this error

rake aborted!  
no such file to load – postgres

(See full trace by running task with --trace)

I’ve looked at the trace and cant see anything of use in there but I’ve  
stuck it at the bottom of the post anyway.

So does anyone know what the problem could be?

Cheers  
Tony

\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
rake aborted!  
no such file to load – postgres  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active\_support/core\_ext/kernel/requires.rb:19:in  
`require_library_or_gem' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/postgresql_adapter.rb:7:in`silence\_warnings’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active\_support/core\_ext/kernel/requires.rb:5:in  
`require_library_or_gem' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/postgresql_adapter.rb:7:in`postgresql\_connection’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:262:in  
`send' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in`connection=’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active\_record/query\_cache.rb:54:in  
`connection=' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in`retrieve\_connection’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:78:in  
`connection' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/migration.rb:284:in`migrate’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/tasks/databases.rake:4  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/tasks/rails.rb:4:in  
`call' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in`execute’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in  
`each' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in`execute’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in  
`invoke' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in`synchronize’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in  
`invoke' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in`top\_level’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in  
`each' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in`top\_level’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in  
`standard_exception_handling' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in`top\_level’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in  
`run' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7:in`standard\_exception\_handling’  
C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in  
`run' C:/Program Files (x86)/NetBeans 6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 :1:in`load’  
:1

---

<div class="post-metadata">

**Author:** ![statictony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@statictony](https://www.ruby-forum.com/u/statictony)\
**Post date:** [December 6, 2007, 5:28pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317/2 "2007-12-06T17:28:11Z")

</div>

You need to install the postgres and/or ruby-postgres gems. I’m not  
sure if both are needed as I’ve had it installed for a while now and  
can’t remember. Beyond that, I believe the adapter name in the  
database.yml file should be postgresql not just postgres.

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![statictony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@statictony](https://www.ruby-forum.com/u/statictony)\
**Post date:** [December 7, 2007, 4:43pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317/3 "2007-12-07T16:43:08Z")

</div>

Cheers Mate,

So I’m now trying to install the gem and this is what I get

Building native extensions. This could take a while…  
Error opening script file: extconf.rb (The system cannot find the file  
specified)  
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)  
ERROR: Failed to build gem native extension.

ruby extconf.rb install postgres --no-rdoc --no-ri  
–include-dependencies --version \> 0

Gem files will remain installed in C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/postgres-0.7.1 for  
inspection.  
Results logged to C:/Program Files (x86)/NetBeans  
6.0/ruby1/jruby-1.0.2/lib/ruby/gems/1.8/gems/postgres-0.7.1/gem\_make.out

Any Ideas anyone?

---

<div class="post-metadata">

**Author:** ![statictony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@statictony](https://www.ruby-forum.com/u/statictony)\
**Post date:** [December 7, 2007, 5:06pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317/4 "2007-12-07T17:06:43Z")

</div>

It looks like you’re missing some development libraries, but I’m not  
sure which one(s). I’ve never tried to get rails working on a  
Windows box, so I really can’t be of much more help. On \*nix, I’d  
probably make sure I have ruby-dev installed for the version of ruby  
I’m using. You could look around and see if there is a ruby  
development installation for Windows.

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![statictony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@statictony](https://www.ruby-forum.com/u/statictony)\
**Post date:** [September 1, 2010, 6:04pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317/5 "2010-09-01T18:04:07Z")

</div>

Mathew M. wrote:

> Its all sorted now…I installed postgres-pr
> 
> and its worked a treat
> 
> thanks for your help phillip

Plz load ‘rubygems’ before ‘postgres’. For example

require ‘rubygems’  
require ‘postgres’

…rest of the code…

May solve ur problem.

---

<div class="post-metadata">

**Author:** ![statictony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@statictony](https://www.ruby-forum.com/u/statictony)\
**Post date:** [September 1, 2010, 6:09pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317/6 "2010-09-01T18:09:51Z")

</div>

Mathew M. wrote:

> Ok,
> 
> Completely new to Rails here and have just started running through some  
> tutorials using
> 
> Netbeans 6  
> Postgres 8.3 beta  
> Windows Vista

Glad you got it working. Just as a side issue, I’d suggest dropping  
NetBeans and Windows. Rails development is actually better without an  
IDE IMHO – try a good editor such as KomodoEdit instead – and  
certainly as you’re just learning the framework, you should not have  
NetBeans getting in your way. And you’ll probably have fewer problems  
if you’re running some sort of \*nix (including Mac OS or a VM –  
VirtualRails seems to be causing something of a splash).

## Best,

Marnen Laibow-Koser

> **[marnen.org: Homepage of Marnen Laibow-Koser](https://marnen.org/)**

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![statictony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@statictony](https://www.ruby-forum.com/u/statictony)\
**Post date:** [December 7, 2007, 5:27pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-postgres-newbie/122317/7 "2007-12-07T17:27:22Z")

</div>

Its all sorted now…I installed postgres-pr

and its worked a treat

thanks for your help phillip
