stripe-archive / mosql

MongoDB → PostgreSQL streaming replication
MIT License
1.63k stars 225 forks source link

Getting Errors While Installing #39

Closed nikilster closed 10 years ago

nikilster commented 10 years ago

Tried this 3-4 times (uninstalling ruby from scratch) and keep getting an error when I try to do "gem install mosql".

Installing on an AWS EC2 instance after following this guide: https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm

Thanks in advance for the help!

ERROR:  Error installing mosql:
    ERROR: Failed to build gem native extension.

    /home/ubuntu/.rvm/rubies/ruby-2.1.1/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=/home/ubuntu/.rvm/rubies/ruby-2.1.1/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

extconf failed, exit code 1

Gem files will remain installed in /home/ubuntu/.rvm/gems/ruby-2.1.1/gems/pg-0.17.1 for inspection.
Results logged to /home/ubuntu/.rvm/gems/ruby-2.1.1/extensions/x86_64-linux/2.1.0/pg-0.17.1/gem_make.out
nelhage commented 10 years ago

You probably need to install libpq-dev -- that's a native C dependency that the pg gem needs in order to compile.

nikilster commented 10 years ago

wow okay that was amazing. I spent several hours trying to fix this. Thanks!

vkarpov15 commented 8 years ago

Just ran into this. Curious, why is this not listed as a dependency in the mosql package or somewhere upstream? Surprise dependencies are a pain.