【问题标题】:Struggling to install pg gem on OSX Lion - "missing required architecture x86_64 in file for architecture x86_64"努力在 OSX Lion 上安装 pg gem - “架构 x86_64 的文件中缺少所需的架构 x86_64”
【发布时间】:2012-01-16 01:59:35
【问题描述】:

我在 OSX Lion 上安装 PostgreSQL gem 时遇到问题。运行gem install pg 后,我在创建makefile 后得到以下输出:

make
/usr/bin/gcc-4.2 -I. -I/Users/Stuart/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.2.0 -I/Users/Stuart/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/Stuart/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/include -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -o compat.o -c compat.c
/usr/bin/gcc-4.2 -I. -I/Users/Stuart/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.2.0 -I/Users/Stuart/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/Stuart/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/include -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -o pg.o -c pg.c
pg.c: In function ‘pgconn_exec’:
pg.c:947: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:986: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_prepare’:
pg.c:1052: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_exec_prepared’:
pg.c:1143: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1173: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_s_escape’:
pg.c:1317: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1324: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query’:
pg.c:1497: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1536: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_prepare’:
pg.c:1601: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query_prepared’:
pg.c:1690: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1721: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_wait_for_notify’:
pg.c:2096: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_put_copy_data’:
pg.c:2166: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_block’:
pg.c:2579: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:2585: warning: format not a string literal and no format arguments
pg.c:2600: warning: format not a string literal and no format arguments
pg.c: In function ‘pgconn_locreate’:
pg.c:2863: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘find_or_create_johab’:
pg.c:3933: warning: comparison between signed and unsigned
pg.c:3939: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_client_encoding_as_rb_encoding’:
pg.c:3967: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_rb_encoding_as_pg_encname’:
pg.c:3999: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_internal_encoding_set’:
pg.c:4058: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_external_encoding’:
pg.c:4114: warning: comparison between signed and unsigned
/usr/bin/gcc-4.2 -dynamic -bundle -o pg_ext.bundle compat.o pg.o -L. -L/Users/Stuart/.rvm/rubies/ruby-1.9.2-p290/lib -L. -L/usr/local/lib -L/usr/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  -lruby.1.9.1 -lpq  -lpthread -ldl -lobjc 
ld: in /usr/local/lib/libssl.0.9.8.dylib, missing required architecture x86_64 in file for architecture x86_64
collect2: ld returned 1 exit status
make: *** [pg_ext.bundle] Error 1

有什么想法吗?我以前没有在 OSX 上使用过 Postgre,所以我的安装可能有问题?

【问题讨论】:

  • 你是如何安装 PostgreSQL 的?显然,ruby 需要一个 x86_64 版本,看起来你已经安装了一个 x86 版本。或者,当它期待一个胖二进制文件时,它会尝试链接一个仅限 x86 的 libssl
  • 我不记得说实话了。我的印象是它默认包含在 Lion 中
  • 已检查:它与 Lion 一起提供,并且安装的版本是通用的 (x86_64/i386)。您的 ruby​​ 可能不是通用的,这可能是您的问题。
  • @Romain 啊,好的。这就说得通了。我将尝试通过自制软件安装 postgre 并使用该版本作为默认版本

标签: ruby-on-rails ruby macos postgresql osx-lion


【解决方案1】:

我在 OS Lion 上遇到了同样的问题。我通过输入以下内容解决了这个问题(在检查了 postgresql requirements 之后):

rm Gemfile.lock

brew install readline(我不确定这里是否需要,但它是 postgresql 的依赖项,我已经拥有最新版本的 ossp-uuid)

brew unlink postgresql

brew install postgresql(执行大约需要 4 分钟)

bundle install

希望对你有帮助!

【讨论】:

    【解决方案2】:

    您似乎正试图在 32 位计算机上安装 64 位版本。检查以确保您为您的操作系统下载了正确的版本。

    【讨论】:

    • 我不记得安装 Postgre。我认为它现在默认包含在 Lion 中。
    • @Pezholio 肯定带有 Lion Server,不确定 Lion 标准,但很有可能。
    猜你喜欢
    • 2015-10-10
    • 2016-02-03
    • 2013-10-15
    • 2013-12-14
    • 2014-12-20
    • 1970-01-01
    • 1970-01-01
    • 2015-04-23
    • 1970-01-01
    相关资源
    最近更新 更多