I am trying to install pg gem to work with my rails projects again. But I get this error:
Create your own extensions. This may take some time ... ERROR: Error installing pg: ERROR: Failed to create native gem 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
cannot try, try again with --with-pg-config = / path / to / pg_config check for libpq-fe.h ... no Cannot find the header libpq-fe.h * extconf.rb failed * The Makefile could not be created for some reason, the necessary libraries and / or headers may have been missing. Check the mkmf.log file for more details. You may need configuration options.
The configuration options provided are: --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 pb = $ {pg-dir} /
Gem files will be installed in /Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0 for verification. Results recorded in /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 is already installed, it is simply not connected
If I try to tie
brew link postgresql Binding / usr / local / Cellar / postgresql / 9.2.4 ... Warning: Failed to bind postgresql. Unlinking ...
Error: unable to create symlink file: / usr / local / Cellar / postgresql / 9.2.4 / share / man / man7 / WITH.7 / usr / local / share / man / man 7 is not writable. You must change permissions.
help me please
NOTE. I have already installed command line tools for mavericks.
If I uninstall using homebrew and try to install it again, I get this error:
==> Download http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.bz2
####################################################### ################# 100.0%==> Fix src / pl / plpython file fix / contrib file fix file / 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 / Basement / p ==> make install-world ==> Cautions
Assembly notes
If PostgreSQL 9 builds do not work, and you have version 8.x, you may need to uninstall the previous version first. Cm:
https://github.com/mxcl/homebrew/issues/issue/2510
Create / update database
If this is your first install, create the database with: initdb / usr / local / var / postgres -E utf8
To migrate existing data from a previous major version (prior to 9.2) of PostgreSQL, see:
http://www.postgresql.org/docs/9.2/static/upgrading.html
Download extensions
By default, Homebrew creates 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, go to the required database and run: CREATE EXTENSION [extension name];
For example, 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 about extensions, see: http://www.postgresql.org/docs/9.2/static/contrib.html
Other
Some machines may need to provide shared memory:
http://www.postgresql.org/docs/9.2/static/kernel-resources.html#SYSVIPC When installing the postgres gem, it is recommended to use ARCHFLAGS: ARCHFLAGS = "- arch x86_64" gem install pg
To set gems without sudo, see the Homebrew wiki.
To start postgresql at login: ln -sfv / usr / local / opt / postgresql / *. Plist ~ / Library / LaunchAgents Then load postgresql now: launchctl load ~ / Library / LaunchAgents / homebrew.mxcl.postgresql.plist if you do not want / need launchctl, you can simply run: pg_ctl -D / usr / local / var / postgres -l / usr / local / var / postgres / server.log start Warning: PostgreSQL could not be linked. Unlinking ... Error: the brew link step did not complete successfully The formula is built, but is not connected by a symbol in / usr / local Try again using the brew postgresql '==> Summary πΊ / usr / local / Cellar / postgresql / 9.2.4: 2831 files, 38M, built in 4.9 minutes
DECISION:
I execute this command to change the folder permission:
sudo chown jeanosorio / usr / local / share / man / man7
Then
brew link postgresql Binding / usr / local / Cellar / postgresql / 9.3.1 ... 421 created symlinks
And finally:
sudo ARCHFLAGS = "- arch x86_64" gem install pg
Extract: pg-0.17.0.gem (100%) Create your own extensions. It could, it may take some time ... Successfully installed pg-0.17.0