- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
这个问题围绕 SO 有很多变化,但似乎没有一个能解决我的问题。
我正在运行 OSX Lion (10.7.3)。安装了最新的 XCode。
我使用来自 postgresapp.com 的 Postgres.app 包安装了 Postgres。
但是当我尝试安装 pg gem 时,我失败了:
$ gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/MacOS/bin/pg_config
checking for libpq-fe.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:40:in `<main>'
Gem files will remain installed in /Users/disaacs/.rvm/gems/ruby-1.9.3-p125/gems/pg-0.13.2 for inspection.
Results logged to /Users/disaacs/.rvm/gems/ruby-1.9.3-p125/gems/pg-0.13.2/ext/gem_make.out
/Applications/Postgres.app/Contents/MacOS/bin/pg_config
命令的输出是:
$ /Applications/Postgres.app/Contents/MacOS/bin/pg_config
BINDIR = /Applications/Postgres.app/Contents/MacOS/bin
DOCDIR = /Applications/Postgres.app/Contents/MacOS/share/doc
HTMLDIR = /Applications/Postgres.app/Contents/MacOS/share/doc
INCLUDEDIR = /Applications/Postgres.app/Contents/MacOS/include
PKGINCLUDEDIR = /Applications/Postgres.app/Contents/MacOS/include
INCLUDEDIR-SERVER = /Applications/Postgres.app/Contents/MacOS/include/server
LIBDIR = /Applications/Postgres.app/Contents/MacOS/lib
PKGLIBDIR = /Applications/Postgres.app/Contents/MacOS/lib
LOCALEDIR = /Applications/Postgres.app/Contents/MacOS/share/locale
MANDIR = /Applications/Postgres.app/Contents/MacOS/share/man
SHAREDIR = /Applications/Postgres.app/Contents/MacOS/share
SYSCONFDIR = /Applications/Postgres.app/Contents/MacOS/etc
PGXS = /Applications/Postgres.app/Contents/MacOS/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/Users/mattt/Code/heroku/Postgres/Postgres/Vendor/postgres' '--enable-thread-safety' '--with-openssl' '--with-gssapi' '--with-bonjour' '--with-krb5' '--with-libxml' '--with-libxslt' '--with-ossp-uuid' '--with-perl' '--with-python'
CC = gcc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL =
LDFLAGS = -Wl,-dead_strip_dylibs
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm
VERSION = PostgreSQL 9.1.3
所有这些设置似乎都是正确的,除了 CONFIGURE 变量(它似乎指的是其他计算机——我没有名为 mattt 的用户)。
mkmf.log文件的内容是
"/usr/bin/gcc-4.2 -o conftest -I/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/x86_64-darwin10.8.0 -I/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/ruby/backward -I/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1 -I. -I/Users/disaacs/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Applications/Postgres.app/Contents/MacOS/include -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib -L/Users/disaacs/.rvm/usr/lib -L. -L/usr/local/lib -L/Applications/Postgres.app/Contents/MacOS/lib -lruby.1.9.1 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
如有任何建议,我们将不胜感激。
我查看了 extconf.rb 文件,经过一些调试我发现它是对
的调用find_header ('libpq-fe.h')
那是失败的。不是因为 libpq-fe.h 不存在,而是因为 find_header
方法本身失败了。我尝试使用 irb 运行 find_header,但得到了同样的错误:
$ irb
1.9.3-p125 :001 > require 'mkmf'
=> true
1.9.3-p125 :002 > find_header 'libpq-fe.h'
checking for libpq-fe.h... RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.
编辑:
发现我的电脑一定比我想象的还要笨。我正在为另一个项目进行捆绑安装,我在安装 sqlite3 gem 时遇到了非常相似的失败。
checking for sqlite3.h... *** extconf.rb failed ***
我过去从未遇到过 sqlite3 gem 的问题。
最佳答案
终于找到问题的原因了!虽然我仍然不确定这个问题是如何产生的。
查看我的安装命令失败时创建的 mkmf.log 文件的内容(请参阅我的原始帖子)。它记录了运行以下命令的尝试
/usr/bin/gcc-4.2 ...and so on...
我的系统上没有/usr/bin/gcc-4.2
。有一个 gcc
,符号链接(symbolic link)到 llvm-gcc-4.2
。我的解决方案是创建另一个符号链接(symbolic link)
sudo ln -s llvm-gcc-4.2 gcc-4.2
创建此链接后,我的 gem install pg
命令正常运行。
我在 Frozen Canuck 博客上的帖子 Error Installing Ruby Gem with C Extension 中找到了这个问题的解决方案.他推测问题可能是由 XCode 的版本冲突引起的。不管是什么原因,我永远的感谢!
关于ruby - gem install pg 不适用于 OSX Lion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10344821/
我带着为 OSX 编写 PAM 模块的永无休止的传奇再次回来了。我已经写好了模块。它在使用 ssh 或启动新的终端窗口或 su 时有效。我真正真正想要的只是 ssh 和登录窗口。 我的 PAM 模块在
我们有一个类似于Soundflower的虚拟音频设备驱动程序。该虚拟设备将在声音系统首选项中列出。每当我们的设备在系统偏好设置中被选择时,它就会阻止空闲 sleep 。如果我们将选择切换为默认输出设备
我带着为 OSX 编写 PAM 模块的永无止境的传奇又回来了。我已经编写了模块。它在使用 ssh 或启动新的终端窗口或 su 时有效。我真的、真的、真的想要的只是 ssh 和登录窗口。 我的 PAM
我想在 osx lion 上安装 pyaudio,但我无法做到。每次我尝试使用 pkg 时,它都不会安装任何东西。当我尝试使用 pip 安装它时,出现以下错误(以及许多其他行): lipo: can'
我使用 Java 进行开发已有很长时间了,但直到最近才从 Windows 切换到 OSX。在 Windows 中,我发现一切都足够简单易懂。我可以将 JDK 安装到一个选择的位置,其中还包括一个 JR
运行 Mac OSX 10.7.5 我想在 USB3 外部硬盘上启用 NTFS 并需要 UUID 来执行此操作( http://ntfsonmac.com ),但 diskutil 拒绝给我 UUID
我正在尝试为 Finder 创建服务,但我的应用程序不需要有 UI。好吧,我只需要一个 UI 来请求用户提供更多信息,我的应用程序有时可能需要这些信息。 但是应用程序应该在没有任何 UI 且 Dock
我正在尝试在我的 mac 上使用本地服务器,但它似乎忽略了/etc/hosts 文件中的 localhost 设置。找到了几个页面,其中解决方案是重新安装,并将 localhost 放在/etc/ho
这是一个 OSX 链接器问题。我不认为 OSX(BSD 或 Mach 层)在乎零页有多大,或者它是否真的存在。我认为这是一个工具的事情。但这是我的意见,这就是我问的原因。 -pagezero_size
我正在构建一个将在 iOS/OSX 应用中使用的模块。 客户坚持认为该模块可以在 iOS 和 OSX 上运行。 我需要检查我在 iOS 和 OSX 上使用 UIDevice 时使用的系统版本 FTWD
我尝试在 OSX 10.8.2 中使用 gnuplot,并看到 x11 是不明确或未知的终端类型。一些研究表明 x11 不受支持,我下载了 XQartz,但我仍然收到相同的错误消息。 我使用 expo
我从官方网站下载了 PostgreSQL 并运行了 .dmg 安装程序。之后我下载了 pgadmin3,我确实能够连接到数据库。 当我运行“psql”时,出现以下错误: psql: could not
自从升级到 OSX Catalina 以来,我一直遇到 UnsatisfiedLinkErrors 问题,尝试在 java 下运行 JNI 包装的库,其中包含多个 native 库引用,这些引用在早期
在 OSX 10.6 上使用 make 构建 C++ 项目时,我确定预处理器定义 __LP64__ 似乎始终自动由编译器(即,它没有在任何头文件中定义)(参见 Where is __LP64__ de
我正在尝试将我的 iOS 应用程序移植到 Mac OS X SDK,并且发现我收到以下错误消息:'Collection' redeclared as a different kind of symbo
我一直在 OSX 10.14 中成功使用我的代码生成 Metal 纹理: let textureLoaderOptions = [MTKTextureLoader.Option.origin : MT
我对编码有些陌生,想用 MySQL 后端启动我的第一个 Django 应用程序。我已经在我的 Windows 机器上使用这个设置将近一年了,但它是一个继承的代码库——不幸的是,我从未尝试过从头开始构建
我正在迁移到一台新计算机,同时从雪豹迁移到狮子。 phpunit 似乎没有进行迁移,所以我重新安装了它。然而,pear 的标准安装似乎不适用于我的 php 家庭brew 安装。这是错误: phpuni
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 已关闭 7 年前。 Improve
我在 OSX10.9 上为我的应用程序构建了一个 Java 7 bundle ,一切看起来都很好,但是当我在 OSX 10.7 上尝试它时,它在启动时崩溃,它已经在 10.7.3 和 10.7.5 上
我是一名优秀的程序员,十分优秀!