不可能在Mavericks上安装PG gem [英] Impossible to Install PG gem on my mac with Mavericks

查看:76
本文介绍了不可能在Mavericks上安装PG gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装pg gem以便再次与我的rails项目一起工作。但是我得到这个错误:


构建原生扩展。这可能需要一段时间...错误:错误
安装pg:错误:无法构建gem本机扩展。

  /Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb检查pg_config ... no否pg_config ...无论如何尝试。如果

建筑失败,请以
--with-pg-config = / path / to / pg_config检查libpq-fe.h ... no找不到'libpq-fe.h头文件
* extconf.rb失败* 无法创建Makefile出于某种原因,可能缺乏必要的库和/或标题。检查
mkmf.log文件以获取更多详细信息。您可能需要配置
选项。



提供的配置选项:--with-opt-dir --without-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 / jeanosorio / .rvm / rubies / ruby​​-2.0.0 -p247 / bin / ruby​​
--with-pg --without-pg --with- pg-config --without-pg-config
--with-pg_config --without-pg_config --with-pg-dir
--without-pg-dir --with-pg-include
--without-pg-include = $ {pg-dir} / include --with-pg-lib
--without-pg-lib = $ {pg-dir} /



Gem文件将保持安装在
/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/中pg-0.17.0
用于检查。记录到
的结果/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0/ext/gem_make.out


我试过了在stackoverflow上找到的所有内容,但仍然收到此错误消息。



如果我尝试使用brew安装postgresql,我会得到以下结果:


警告:已经安装postgresql-9.2.4,它只是没有链接


如果我尝试链接


brew链接postgresql链接/usr/local/Cellar/postgresql/9.2.4 ...
警告:无法链接postgresql。取消链接...



错误:无法符号链接文件:
/usr/local/Cellar/postgresql/9.2.4/share/man/man7/WITH .7
/ usr / local / share / man / man7不可写入。您应该更改其
权限。


帮助请

注意:我已经为mavericks安装了命令行工具。






如果我使用自制软件卸载并尝试再次安装,得到这个错误:


==>正在下载 http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.bz2



########################################### ####################### 100.0%

==>修补修补文件src / pl / plpython / Makefile修补文件contrib / uuid-ossp / uuid-ossp.c
==> ./configure --prefix = / usr / local / Cellar / postgresql / 9.2.4 --datadir = / usr / local / Cellar / postgresql /9.2.4/share/postgresql --docdir = / usr / local / Cellar / p
==> make install-world
==>注意事项



构建注释



如果PostgreSQL 9的构建失败并且您安装了版本8.x
,您可能需要先删除以前的版本。请参阅:

https://github.com/mxcl/homebrew/issues/issue/2510



创建/升级数据库



如果这是您的第一次安装,请创建一个数据库:initdb
/ usr / local / var / postgres -E utf8



要迁移$ b $之前的主要版本(9.2之前版本) b PostgreSQL,请参阅:

http://www.postgresql.org/docs/ 9.2 / static / upgrading.html



加载扩展



默认情况下,Homebrew会构建所有可用Contrib扩展。要从psql命令行查看所有可用扩展的
列表,请运行:

SELECT * FROM pg_available_extensions;

要加载任何扩展名,导航到所需的数据库
并运行:CREATE EXTENSION [扩展名];

例如,要加载当前数据库
run:CREATE EXTENSION tablefunc;

有关CREATE EXTENSION命令的更多信息,请参阅:

http://www.postgresql.org/docs/9.2/static/sql-createextension.html For
有关扩展程序的更多信息,请参阅:

http:// www。 postgresql.org/docs/9.2/static/contrib.html



其他



有些机器可能需要调配共享内存:

http://www.postgresql.org/docs/9.2/static/kernel-resources.html#SYSVIPC
安装postgres gem时,包括ARCHFLAGS建议:
ARCHFLAGS = - arch x86_64gem install pg



要安装gems而不使用sudo,请参阅Homebrew wiki。



要让launchd在登录时启动postgresql:
ln -sfv /usr/local/opt/postgresql/*.plist〜/ Library / LaunchAgents然后现在加载postgresql:
或者,如果您不需要
想要/需要launchctl,那么您可以运行:
pg_ctl -D / usr / local / var / launchgl load〜/ Library / LaunchAgents / homebrew.mxcl.postgresql.plist postgres -l /usr/local/var/postgres/server.log start警告:无法链接
postgresql。取消链接...错误: brew链接步骤未成功完成
该公式已构建,但未链接到/ usr / local
中再试一次`brew link postgresql'
==>总结

I'm trying to install the pg gem in order to work again with my rails projects. But I get this error:

Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension.

/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If

building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header * 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 --without-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/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby --with-pg --without-pg --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/

Gem files will remain installed in /Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0 for inspection. Results logged to /Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0/ext/gem_make.out

I tried everything I found on stackoverflow but I still get this error.

If I try to install postgresql using brew I get the following waring:

Warning: postgresql-9.2.4 already installed, it's just not linked

If I try to link

brew link postgresql Linking /usr/local/Cellar/postgresql/9.2.4... Warning: Could not link postgresql. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/postgresql/9.2.4/share/man/man7/WITH.7 /usr/local/share/man/man7 is not writable. You should change its permissions.

Help Please

NOTE: I already installed the command line tools for mavericks.


If I uninstall using homebrew and try to install again, I get this error:

==> Downloading http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.bz2

################################################################## 100.0%

==> Patching patching file src/pl/plpython/Makefile patching file contrib/uuid-ossp/uuid-ossp.c ==> ./configure --prefix=/usr/local/Cellar/postgresql/9.2.4 --datadir=/usr/local/Cellar/postgresql/9.2.4/share/postgresql --docdir=/usr/local/Cellar/p ==> make install-world ==> Caveats

Build Notes

If builds of PostgreSQL 9 are failing and you have version 8.x installed, you may need to remove the previous version first. See:
https://github.com/mxcl/homebrew/issues/issue/2510

Create/Upgrade a Database

If this is your first install, create a database with: initdb /usr/local/var/postgres -E utf8

To migrate existing data from a previous major version (pre-9.2) of PostgreSQL, see:
http://www.postgresql.org/docs/9.2/static/upgrading.html

Loading Extensions

By default, Homebrew builds all available Contrib extensions. To see a list of all available extensions, from the psql command line, run:
SELECT * FROM pg_available_extensions;

To load any of the extension names, navigate to the desired database and run: CREATE EXTENSION [extension name];

For instance, to load the tablefunc extension in the current database, run: CREATE EXTENSION tablefunc;

For more information on the CREATE EXTENSION command, see:
http://www.postgresql.org/docs/9.2/static/sql-createextension.html For more information on extensions, see:
http://www.postgresql.org/docs/9.2/static/contrib.html

Other

Some machines may require provisioning of shared memory:
http://www.postgresql.org/docs/9.2/static/kernel-resources.html#SYSVIPC When installing the postgres gem, including ARCHFLAGS is recommended: ARCHFLAGS="-arch x86_64" gem install pg

To install gems without sudo, see the Homebrew wiki.

To have launchd start postgresql at login: ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents Then to load postgresql now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist Or, if you don't want/need launchctl, you can just run: pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start Warning: Could not link postgresql. Unlinking... Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local You can try again using `brew link postgresql' ==> Summary

这篇关于不可能在Mavericks上安装PG gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆