Comments (9)
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Can you also attach or paste your mkmf.log? That will have the specifics as to why it can't find the libpq-fe.h header.
Thanks!
PS: while I do all of my development on a Mac, I haven't tested this under 1.9.1 since 1.9.2 came out. I doubt that's the issue, however.
from ruby-pg.
Original comment by sl_bug (Bitbucket: sl_bug, ).
i don't know why 1.9.1 in path, but i use ruby 1.9.3
ruby -v output:
ruby 1.9.3dev (2010-11-20 trunk 29843) [x86_64-darwin10.5.0]
P.S. using ruby 1.9.2 i got same error. and strange 1.9.1 in path too - "/Users/user/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/mkmf.rb"
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Oh, right, I forgot that 1.9.2 uses the 1.9.1 library path; I don't know why, but that's normal. Thanks for the log.
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
I think the problem is that your libpq is compiled as a universal binary (with three architectures) and your Ruby is compiled without at least one of them. If you do a file
which ruby``, it should show which architectures your Ruby supports, and you'll have to either reinstall PostgreSQL with only those architectures, or your Ruby with all three that your Postgres supports.
For example, my system Ruby says:
$ file `which ruby`
/usr/bin/ruby: Mach-O universal binary with 3 architectures
/usr/bin/ruby (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/ruby (for architecture i386): Mach-O executable i386
/usr/bin/ruby (for architecture ppc7400): Mach-O executable ppc
while my rvm-installed 1.9.2 says:
$ rvm 1.9.2
$ file `which ruby`
[...]/.rvm/rubies/ruby-1.9.2-p0/bin/ruby: Mach-O 64-bit executable x86_64
The clue is in the linker phase from the mkmkf.log:
lipo: can't figure out the architecture type of: /var/folders/DR/DR5qjIGGEWiVOvkRtZ5u3E+++TI/-Tmp-//ccqYG1Im.out
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
That's why I put that warning in the extconf that says:
*** Your PostgreSQL installation doesn't seem to have an architecture in
common with the running ruby interpreter (["ppc", "i386", "x86_64"] vs. [])
I'll continue anyway, but if it fails, try setting ARCHFLAGS.
testing for architecture: "ppc"
testing for architecture: "i386"
testing for architecture: "x86_64"
from ruby-pg.
Original comment by sl_bug (Bitbucket: sl_bug, ).
I haven't compiled postgres by myself, i downloaded binary. seems like only one way to fix it is compile ruby as universal binary or set ARCHFLAGS='-arch x86_64' before installing pg gem.
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Even setting the architecture yourself won't work, as it won't be able to link completely due to the missing architectures. If you want to use the installation of PostgreSQL you're currently using, the only way (that I know of) is, as you say, to compile Ruby with the same three architectures that your Postgres supports.
from ruby-pg.
Original comment by sl_bug (Bitbucket: sl_bug, ).
setting archflags helped. at least gem installed successfully and it works.
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Oh, good! I didn't think you could link that way, but I stand corrected. Thanks for trying, and especially for reporting that it worked. :)
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Removing component: build-system (automated comment)
from ruby-pg.
Related Issues (20)
- PG::Coder.new(hash) is deprecated HOT 6
- Timezone timestamp decoder behavior mismatch with hash vs. keyword arguments on v1.5.0 HOT 1
- PG 1.5.0 may have broken COPY exports HOT 2
- Seg fault after upgrading to pg v1.5.2 HOT 3
- Saw Rails DB connection pool spike after upgrading from 1.4.6 to 1.5.2 HOT 5
- failed to install pg 1.4.6 on Centos7 with ruby 3.2.0, whereas with ruby 3.1.0 it installs HOT 3
- How to build an old pg on ruby 2.3.1 HOT 1
- Segmentation fault with ruby 2.7.8 and pg 1.5.3 HOT 10
- Segmentation fault HOT 27
- Sonoma: getaddrinfo segmentation fault HOT 2
- Segmentation fault in ruby:3.2.2-alpine3.18 docker image HOT 2
- Wrong binary conversion on x86 (32bit intel) arch causing test failures HOT 4
- Bad IAM Token against Amazon Aurora Postgres: Out of memory error HOT 2
- Attempting to execute a sql file with `\set ...` raises errors HOT 3
- conn.exec writing "INFO" statements to stderr instead of stdout HOT 2
- Segfault on ruby 3.2.2, pg 1.5.4 HOT 2
- Error ruby(39749,0x1e1f05300) malloc: double free for ptr 0x13c6bfa00 HOT 1
- Segmentation fault when connecting to RDS HOT 11
- Broken links in documentation HOT 3
- connection.reset don't check again DNS HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-pg.