Re: i get a very strange load file error

1,124 views
Skip to first unread message

Michael Granger

unread,
Mar 12, 2013, 8:32:05 PM3/12/13
to rub...@googlegroups.com
Hi,

When the binary versions of the latest pg gem was released, Ruby 2.0 was not yet out, so there's no 2.0 extension in any current binary gem. Version 0.15.0 is due out soon, and it should include support for Ruby 2.

dane.a...@gmail.com

unread,
Jul 16, 2013, 12:16:15 PM7/16/13
to rub...@googlegroups.com
I am trying to upgrade to ruby 2.0.0 now, but I can't get the pg gem to work. I keep getting that error message "`require': cannot load such file -- pg_ext (LoadError)". Everything installs just fine in the first place, and it makes no difference if I use the -- --with-pg-config parameter either. Any idea why this would happen?

Lars Kanis

unread,
Jul 17, 2013, 4:38:50 AM7/17/13
to rub...@googlegroups.com
Hi,

pg-0.15.0+ is released as binary gem on windows for ruby-1.8, 1.9 and 2.0 (x86-mingw32 and x64-mingw32). Unfortunately rubygems bundled with ruby-2.0.0-p0 has a bug related to precompiled gems. Please update to ruby-2.0.0-p247 or do gem update --system. If this doesn't work, please post the command line output, you got.

Regards,
Lars

gerbr...@gmail.com

unread,
Aug 6, 2013, 7:54:44 AM8/6/13
to rub...@googlegroups.com, la...@greiz-reinsdorf.de
I tried what you suggested by updating my ruby to the latest. My rubygems are already at the latest version 2.0.6. When I do a "sudo gem install pg" I get the following error messages:

ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb --with-pg_config=/opt/PostgreSQL/9.2/include/
Using config values from /opt/PostgreSQL/9.2/include/
sh: 1: /opt/PostgreSQL/9.2/include/: Permission denied
sh: 1: /opt/PostgreSQL/9.2/include/: Permission denied
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***

You may
need configuration options."

Any suggestions on how I can get this pg gem installed??

Thanks

Michael Granger

unread,
Aug 6, 2013, 11:23:38 AM8/6/13
to rub...@googlegroups.com, la...@greiz-reinsdorf.de, gerbr...@gmail.com
On Tuesday, August 6, 2013 4:54:44 AM UTC-7, gerbr...@gmail.com wrote:
I tried what you suggested by updating my ruby to the latest. My rubygems are already at the latest version 2.0.6. When I do a "sudo gem install pg" I get the following error messages:

ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb --with-pg_config=/opt/PostgreSQL/9.2/include/
Using config values from /opt/PostgreSQL/9.2/include/
sh: 1: /opt/PostgreSQL/9.2/include/: Permission denied
sh: 1: /opt/PostgreSQL/9.2/include/: Permission denied
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***

You may
need configuration options."

Any suggestions on how I can get this pg gem installed??

It looks like the permissions on the 'include' directory are such that you can't access them as whatever user you're installing 'pg' with.  The permissions are typically set by the installer, but you may need to adjust them a bit, or become a user which can access those directories when installing/using PostgreSQL-related software. Did you install PostgreSQL yourself? Do you have root access to the machine?


Lars Kanis

unread,
Aug 7, 2013, 8:24:02 AM8/7/13
to gerbr...@gmail.com, rub...@googlegroups.com
Am 06.08.2013 13:54, schrieb gerbr...@gmail.com:
> I tried what you suggested by updating my ruby to the latest. My
> rubygems are already at the latest version 2.0.6. When I do a "sudo
> gem install pg" I get the following error messages:

You should pass the correct pg_config file to gem install. Probably
something like: sudo gem inst pg --
--with-pg-config=/opt/PostgreSQL/9.2/bin/pg_config

Regards,
Lars

Gerald Brown

unread,
Aug 8, 2013, 6:59:44 AM8/8/13
to rub...@googlegroups.com
Thanks. That did the trick and the pg gem was installed successfully.
Reply all
Reply to author
Forward
0 new messages