I've looked all the solutions in the internet for this, reinstalled everything and still nothing... When i do gem install pg i get:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb --with-pgsql->lib=/usr/local/Cellar/postgresql/9.2.1/lib --with-pg->config=/usr/local/Cellar/postgresql/9.2.1/bin/pg_config
Using config values from /usr/local/Cellar/postgresql/9.2.1/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/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/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/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/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/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:intry_cpp'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:970:in block in find_header'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:inblock in checking_for'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in block (2 levels) in postpone'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:inopen'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in block in postpone'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:inopen'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in postpone'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:inchecking_for'
from /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:969:in find_header'
from extconf.rb:41:in'
Gem files will remain installed in /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1/gems/pg-0.14.1 for inspection.
Results logged to /Users/henriquedubugras/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1/gems/pg-0.14.1/ext/gem_make.out
I tried setting the pg_config path, my xcode is installed, my command line tools from xcode is installed, my ruby version is 1.9.3 installed by RVM.
My mac is OS X Mountain Lion
Thanks guys!
You're missing the Postgres client library header files (libpq-fe.h). In Debian the package is called libpq-dev. I don't know Mac packaging at all, but if there's no Mac respository building the PG client libs from source would work.
i would recommend installing rvm https://rvm.io/rvm/install
then run rvm requirements. this will install all required packages, you're probably missing "gcc49" after this install rails and yore good to install postgres. i would suggest postgresapp or postgresql.
Related
I'm trying to combine a Rails app and PostgreSQL on the same Azure virtual machine.
I installed PostgreSQL 9.5 following this guide and it seems to give no problems by itself. Now the problem is, I cannot install the pg gem. Specifically, running the command gem install pg -v '0.19.0', it gives me the following error:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/pg-0.19.0/ext
/usr/bin/ruby2.3 -r ./siteconf20170122-18144-1ee3id1.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
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=/usr/bin/$(RUBY_BASE_NAME)2.3
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--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}/lib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/pg-0.19.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/pg-0.19.0 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/pg-0.19.0/gem_make.out
Any help is really appreciated. Cheers
What is the response of which pg_config
If it is something like:
/usr/bin/which: no pg_config in...
Try installing again with below command:
sudo apt-get install postgresql-devel
As simple as it was, I just needed to install postgresql-server-dev-9.5 on my Azure Ubuntu VM. I just overlooked the error log :D
When running the gem install sqlite3 command on Mac OS X I experience the following error message:
Users-MacBook-Pro:~ user$ gem install sqlite3
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/user/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for sqlite3.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
--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/user/.rvm/rubies/ruby-2.1.2/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
/Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:1120:in `block in find_header'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:1119:in `find_header'
from extconf.rb:35:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.1.2/gems/sqlite3-1.3.9 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/sqlite3-1.3.9/gem_make.out
Users-MacBook-Pro:~ user$
I am relatively new to using the terminal, ruby on rails and ruby gems and have been scratching my head (i.e. searching google) for a few hours now, any help would be greatly appreciated. Have tried the sudo command but no luck there.
You should install sqlite3 in your OSX first
brew install sqlite3
Ok, so I ended up throwing the kitchen sink at this one in the end. Here are the steps I took to resolve the issue.
uninstalled RVM link
uninstalled App Store version of xcode as had it previously installed link
ran $ xcode-select --install in terminal to install command line tools
as I already have Homebrew installed I added Homebrews binary path to the front of the $PATH link
$ echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile
ran $ brew install sqlite3 command
reinstalled RVM
I believe the steps which mitigated the issue the most were 2,3,4 and 5.
Hope this helps!
After installing OS X Mavericks, I cannot get an old Rails 4 app to work. The main issue seems to be trouble installing the pg gem:
Christophers-MacBook-Pro-2:DataSquid christopherspears$ gem install pg -v '0.17.1'
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Christophers-MacBook-Pro-2:DataSquid christopherspears$ sudo gem install pg -v '0.17.1'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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 /Library/Ruby/Gems/2.0.0/gems/pg-0.17.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/pg-0.17.1/ext/gem_make.out
I am not sure what the issue is. I did install the command line tools for OS X Mavericks for Xcode (late October 2013), but that did not resolve the issue.
As this question recommends, the easiest way is to install Postgres.app and then run
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
to install the pg gem using the Postgres.app pg_config.
I am new to rails and attempting to switch my default DB to Postgres from SQLite3. I have encountered an error. I am using gem install pg and getting this error error: Error installing pg: ERROR: Failed to build gem native extension. I am using Mavericks OSX and Ruby 1.9.3, Rails 3.2.12, and PG 9.3 –The goal is to deploy a sample app to heroku (which doesnt seem to support SQLite.
Steps I have tried:
link 1: Installing PG gem on OS X - failure to build native extension
link 2(heroku instructions): https://devcenter.heroku.com/articles/sqlite3
EDITED TO INCLUDE SPECIFIC ERROR MESSAGE BELOW:
HEAD https://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
304 Not Modified
HEAD https://rubygems.org/specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
304 Not Modified
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/.gemtest
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/BSDL
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ChangeLog
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/Contributors.rdoc
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/History.rdoc
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/LICENSE
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/Manifest.txt
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/POSTGRES
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/README-OS_X.rdoc
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/README-Windows.rdoc
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/README.ja.rdoc
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/README.rdoc
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/Rakefile
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/Rakefile.cross
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/errorcodes.def
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/errorcodes.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/errorcodes.txt
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/extconf.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/gvl_wrappers.c
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/gvl_wrappers.h
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/pg.c
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/pg.h
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/pg_connection.c
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/pg_errors.c
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/pg_result.c
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/vc/pg.sln
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/vc/pg_18/pg.vcproj
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/ext/vc/pg_19/pg_19.vcproj
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/lib/pg.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/lib/pg/connection.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/lib/pg/constants.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/lib/pg/exceptions.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/lib/pg/result.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/array_insert.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/async_api.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/async_copyto.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/async_mixed.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/check_conn.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/copyfrom.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/copyto.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/cursor.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/disk_usage_report.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/issue-119.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/losample.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/minimal-testcase.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/notify_wait.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/pg_statistics.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/replication_monitor.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/test_binary_values.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/wal_shipper.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/sample/warehouse_partitions.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/spec/data/expected_trace.out
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/spec/data/random_binary_data
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/spec/lib/helpers.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/spec/pg/connection_spec.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/spec/pg/result_spec.rb
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.17.0/spec/pg_spec.rb
Building native extensions. This could take a while...
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
*** 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=/usr/local/rvm/rubies/ruby-1.9.3-p392/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}/lib
/usr/local/rvm/rubies/ruby-1.9.3-p392/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 /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from extconf.rb:39:in `<main>'
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
Building has failed. See above output for more information on the failure.
Gem files will remain installed in /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/pg-0.17.0 for inspection.
Results logged to /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/pg-0.17.0/ext/gem_make.out
It's trying to build the gem pg, which has C or C++ code in it, and the compilation phase is not working. Under OS X, you must install XCode or get a compiler by other means, and the shell you're using to run bundle install must have the compiler in its path. I've compiled pg many times under OS X, though I have not upgraded to Mavericks.
If you have XCode installed, the above paragraph doesn't apply. You'll get additional information on what's going wrong if you try gem install pg. Try that and post the results.
The key is "You have to install development tools first." This is a strong hint that you don't have a proper compiler. This page says XCode must be v5.01 or later.
Thanks all for your help. The specific issue was resolved by me running the below command in terminal
brew install apple-gcc42
To clarify, I had the most recent XCode (with command line) and Mavericks, Ruby 1.9.3, Rails 3.2.12, and PG 9.3. I am unsure why that specific command worked when I already had the command line tools installed. The one change of the output of
gcc--version
was that --prefix=/Library/Developer/CommandLineTools/usr
changes to
--prefix=/Applications/Xcode.app/Contents/Developer/usr
Again, this change worked in practice, but I am not sure why this fixed things.
I am not sure what happened - I know Postgres was working right after the upgrade to Lion, but it is not working anymore. I have Xcode 4 installed.
error:
$ gem install pg -- --with-pg-config=/usr/bin/pg_config
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/Me/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb --with-pg-config=/usr/bin/pg_config
Using config values from /usr/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/Me/.rvm/rubies/ruby-1.9.2-p318/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/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/Me/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
from extconf.rb:40:in `<main>'
Gem files will remain installed in /Users/Me/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.13.2 for inspection.
Results logged to /Users/Me/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.13.2/ext/gem_make.out
EDIT*** I tried installing postgres via homebrew and got the following errors:
Warning: You have no /usr/bin/cc.
This means you probably can't build *anything*. You need to install the Command
Line Tools for Xcode. You can either download this from http://connect.apple.com
or install them from inside Xcode's Download preferences. Homebrew does not
require all of Xcode! You only need the Command Line Tools package!
Warning: Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
Warning: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libruby.1.8.7.dylib
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libruby-static.a
Warning: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
bundle
edit_json.rb
erb
erubis
gem
irb
prettify_json.rb
rails
rake
rake2thor
rdoc
ri
ruby
testrb
thor
tt
update_rubygems
Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.
Warning: Your Xcode is configured with an invalid path.
You should change it to the correct path. Please note that there is no correct
path at this time if you have *only* installed the Command Line Tools for Xcode.
If your Xcode is pre-4.3 or you installed the whole of Xcode 4.3 then one of
these is (probably) what you want:
sudo xcode-select -switch /Developer
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Trying forcing pg gem to build with the 64 bit libpg version.
ARCHFLAGS='-arch x86_64' gem install pg
Check out the following blog post: Using MySQL and Postgres on Mac OS X (Tiger) with RoR