Gem install pg works but bundle install fails - ruby

There is very lot of topics about this but I already try almost all of them with no success.
I'm on Mac OS X 10.9.4 Mavericks, I have the Postgres.app, and it seams to work fine, sudo gem install pg works too :
Building native extensions. This could take a while...
Successfully installed pg-0.17.1
invalid options: -f fivefish
(invalid options are ignored)
Parsing documentation for pg-0.17.1
Done installing documentation for pg after 2 seconds
1 gem installed
but when I try to bundle install I have the same error than every one else.
I already try bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
then bundle install
I have the Xcode Command Line Tools.
which psqlreturn /Applications/Postgres.app/Contents/Versions/9.3/bin/psql
which postgresreturn /Applications/Postgres.app/Contents/Versions/9.3/bin/postgres
Here is the error for bundle install:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
extconf failed, exit code 1
Gem files will remain installed in /var/folders/07/my1cl5xj7g9cknnp3y2zg_rh0000gn/T/bundler20140723-29399-1o0uzqn/pg-0.17.1/gems/pg-0.17.1 for inspection.
Results logged to /var/folders/07/my1cl5xj7g9cknnp3y2zg_rh0000gn/T/bundler20140723-29399-1o0uzqn/pg-0.17.1/extensions/universal-darwin-13/2.0.0/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.

After days I finally found the problem source (ironically when I decide to give up, and move on).
When I do a
which bundle and which gem
They were not from the same ruby installation.
bundle was from rbenv and gem from the preinstalled ruby on mac osx.

might have the permission issue. can use:
sudo bundle install --without nothing --path vendor/cache

Related

Error installing pg Gem with 'bundle install'. Fails to build native extensions

When I run bundle install it gives:
Installing pg 0.18.4 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin
Using config values from /Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin
sh: /Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin: No such file or directory
sh: /Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin: No such file or directory
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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
--enable-windows-cross
--disable-windows-cross
--with-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}/
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Gem files will remain installed in /var/folders/6m/cn4bddqx4yz3jgl54hwccscc0000gn/T/bundler20160509-18530-6yu7yypg-0.18.4/gems/pg-0.18.4 for inspection.
Results logged to /var/folders/6m/cn4bddqx4yz3jgl54hwccscc0000gn/T/bundler20160509-18530-6yu7yypg-0.18.4/gems/pg-0.18.4/ext/gem_make.out
Using rack 1.6.4
Using tilt 2.0.1
Using bundler 1.11.2
Using tzinfo 1.2.2
Using ripl 0.7.1
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
I've run gem install pg -v '0.18.4' and it installs successfuly:
But when I run 'bundle install' again, it gives the same error.
I have postgresql running and have run brew update as well, but still facing the error.

Unable to install tiny_tds on Mac OS X Yosemite v10.10.2

I am using RubyMine IDE on MAC OS X yosemite. On trying to install tiny_tds its giving the following error
sudo gem install tiny_tds -v '0.6.2'
Building native extensions. This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... no
freetds is missing.
* 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
--enable-lookup
--disable-lookup
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/
--with-iconvlib
--without-iconvlib
--with-sybdblib
--without-sybdblib
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.6.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.6.2/ext/tiny_tds/gem_make.out
I have installed freetds
brew install freetds
and I can see it when I do brew list
but again when I do sudo gem install tiny_tds , it gives me error as freetds missing.
Please help.
Thanks
Did gem install tiny_tds not work?
FYI - Using sudo with gem install is not best practice.
As I posted at Homebrew / TinyTDS / FreeTDS bundle error, in addition to brew install freetds, you may also need to tell the gem where to find freetds.
If you are using bundler, you can do that by configuring bundler.
For example (depending where exactly homebrew installed freetds):
bundle config set --global build.tiny_tds --with-freetds-dir=/opt/homebrew/Cellar/freetds/1.3.3

Unable to install gem "pg" on Ubuntu 12.10 (AMD64)

I've been (unsuccessfully) trying to install the "pg" gem on my ruby 1.9.3-p286 but nothing seems to work.
I've already installed postgresql (9.1), libpq-dev and a few others like postgresql-server-dev-9.1. I've tried to pass the "with-pg-config" flag to the gem install but simply nothing seems to work.
Every time I try to install the gem it outputs something like this:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/home/lynux/.rvm/rubies/ruby-1.9.3-p286/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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=/home/lynux/.rvm/rubies/ruby-1.9.3-p286/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
--without-pg-config
--with-pg_config
--without-pg_config
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Gem files will remain installed in /home/lynux/.rvm/gems/ruby-1.9.3-p286#phisiodata/gems/pg-0.14.1 for inspection.
Results logged to /home/lynux/.rvm/gems/ruby-1.9.3-p286#phisiodata/gems/pg-0.14.1/ext/gem_make.out
What am I doing wrong? Is there something else that I should do before trying to install the gem?
Thank you in advance.
[EDIT]
Ok, so joelparkerhenderson's answer set me to think that there might me something wrong with paths and libraries and a went on digging a little bit further..
I've found this awesome post and it solved! Basically the problem lies with RVM. So, my problem is solved and for anyone out there that might suffer from the same thing, follow the link!
Your error looks like you're missing libpq-dev
Are you about to install Postgres first on the system?
Try this:
sudo apt-get install postgresql postgresql-client postgresql-server-dev-all libpq-dev
Next, are you able to install the pg gem as root?
sudo su - root
gem install pg

pg gem can't find native extensions -- PostgreSQL installed using Homebrew

I'm on Mac OS X 10.8.2, which I reinstalled a few hours ago in frustration with the issues that follow.
I have installed Homebrew, and when I run brew doctor, it says Your system is raring to brew.
I have the latest Xcode with the command-line utilities.
I have installed PostgreSQL using Homebrew.
steven$ ls /usr/local/Cellar/postgresql/9.2.1
COPYRIGHT README homebrew.mxcl.postgresql.plist lib
INSTALL_RECEIPT.json bin include share
steven$ psql --version
psql (PostgreSQL) 9.2.1
iMac-001EC20A3C44-5:9.2.1 steven$ which psql
/usr/local/bin/psql
I have a Rail app with gem 'pg' in its Gemfile, but I can't install the gem:
steven$ bundle install
Fetching source index for http://rubygems.org/
Installing pg (0.14.1) with native extensions /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-pg-config=/usr/pgsql-9.1/bin/pg_config
Using config values from /usr/pgsql-9.1/bin/pg_config
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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.
It seems to be looking for pg_config and libpq, which are easy enough to find:
steven$ ls /usr/local/Cellar/postgresql/9.2.1/bin
... pg_config ...
steven$ ls /usr/local/Cellar/postgresql/9.2.1/include
... libpq ...
So I've tried passing every configuration option I can think of, but none work:
steven$ sudo gem install pg -- --with-pg-config="/usr/local/Cellar/postgresql/9.2.1/bin"
Password:
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/1.8/usr/bin/ruby extconf.rb --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin
Using config values from /usr/local/Cellar/postgresql/9.2.1/bin
sh: /usr/local/Cellar/postgresql/9.2.1/bin: is a directory
sh: /usr/local/Cellar/postgresql/9.2.1/bin: is a directory
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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/1.8/usr/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
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
steven$ sudo gem install pg -- --with-pg-config="/usr/local/Cellar/postgresql/9.2.1/bin" --with-libpqlib="/usr/local/Cellar/postgresql/9.2.1/include"
Password:
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/1.8/usr/bin/ruby extconf.rb --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin --with-libpqlib=/usr/local/Cellar/postgresql/9.2.1/include
Using config values from /usr/local/Cellar/postgresql/9.2.1/bin
sh: /usr/local/Cellar/postgresql/9.2.1/bin: is a directory
sh: /usr/local/Cellar/postgresql/9.2.1/bin: is a directory
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -l/usr/local/Cellar/postgresql/9.2.1/include... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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/1.8/usr/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
--with-pqlib
--without-pqlib
--with-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
steven$ sudo gem install pg --with-pg-config="/usr/local/Cellar/postgresql/9.2.1/bin" --with-libpqlib="/usr/local/Cellar/postgresql/9.2.1/include"
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin
steven$ sudo gem install pg --with-pg-config="/usr/local/Cellar/postgresql/9.2.1/bin/" --with-libpqlib="/usr/local/Cellar/postgresql/9.2.1/include/"
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin/
steven$ sudo gem install pg --with-pg-config='/usr/local/Cellar/postgresql/9.2.1/bin/' --with-libpqlib='/usr/local/Cellar/postgresql/9.2.1/include/'
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin/
steven$ sudo gem install pg -- --with-pg-config='/usr/local/Cellar/postgresql/9.2.1/bin/' --with-libpqlib='/usr/local/Cellar/postgresql/9.2.1/include/'
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/1.8/usr/bin/ruby extconf.rb --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin/ --with-libpqlib=/usr/local/Cellar/postgresql/9.2.1/include/
Using config values from /usr/local/Cellar/postgresql/9.2.1/bin/
sh: /usr/local/Cellar/postgresql/9.2.1/bin/: is a directory
sh: /usr/local/Cellar/postgresql/9.2.1/bin/: is a directory
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -l/usr/local/Cellar/postgresql/9.2.1/include/... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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/1.8/usr/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
--with-pqlib
--without-pqlib
--with-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
steven$ sudo gem install pg --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin/ --with-libpqlib=/usr/local/Cellar/postgresql/9.2.1/include
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin/
iMac-001EC20A3C44-5:testivate steven$ sudo gem install pg --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin/pg_config
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --with-pg-config=/usr/local/Cellar/postgresql/9.2.1/bin/pg_config
What should I do?
FYI, I eventually solved this by uninstalling everything from PostgreSQL and the pg gem right down to Bundler, Homebrew and even RVM before installing every piece again one at a time. Probably I removed more than I had to but everything worked once I put it all back together again.
I don't know if this will help anyone else or not but I had the exact same problem here with PG gem not compiling. My apps live on Heroku, and locally I use RVM, Homebrew, but for Postgres I am using Postgresapp.com
I also use JewerlyBox to give me a nice GUI wrapper around RVM. I compared my Ruby 1.9.3-p194 to 1.9.3-p286 and noticed that I had set 286 to universal. I was hesitant to uninstall everything so I just uninstalled Ruby and reinstalled with the option set to 64-bit only (platform: "x86_64-darwin12.2.0").
After reinstalling Ruby with this option, the PG gem installed without a hitch and I am back to being happy. Hope this helps someone.

Unable to install sqlite3-ruby gem

I've xcode 3.0 installed. And I need to install sqlite3-ruby gem (for rhosync).
When I run:
sudo gem install -l sqlite3-ruby
I get following error:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for #include <sqlite3.h>
... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... no
checking for sqlite3_initialize()... no
sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!
*** 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/1.8/usr/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
--with-sqlite3lib
--without-sqlite3lib
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out
I've checked many links (on Stack Overflow and other sites) but nothing seems to work.
Some people suggest that install Ruby Headers from Mac OS X Disk 2. But I don't have that disc. I've instead installed XCode 3.0 SDK.
What should I do?
I installed MacPorts from http://macports.org and then ran
sudo port install sqlite3
after that sqlite3-ruby installed successfully.

Resources