Giter Club home page Giter Club logo

Comments (8)

jeremyolliver avatar jeremyolliver commented on July 30, 2024

FYI it's no longer recommended to install chef into a standard system ruby. You should use the official chef installation methods, known as an 'omnibus' install (http://www.getchef.com/chef/install/), I suspect that will fix your error.

This includes a separate ruby, and chef install into /opt/chef which means that all the right ruby extensions needed for chef will be compiled in (and a tested version of ruby), and compatible versions of extension libraries as well.

This is why there are different resources for gem_package (installs to system gems) and chef_gem (installs to the ruby that chef is currently running from)

from postgresql.

chriskilding avatar chriskilding commented on July 30, 2024

I'm using the omnibus install method, and it still breaks. This purely seems to be happening because something in the postgres recipe is installing the pg gem with native C extension.

from postgresql.

roboyak avatar roboyak commented on July 30, 2024

Yea I'm seeing this same issue.

from postgresql.

hulu1522 avatar hulu1522 commented on July 30, 2024

Same problem here. I could install pg correctly using the system ruby1.9.1-dev but the cookbook uses the chef embedded ruby. Somewhere something is not updated or is missing. Please fix this major issue. Here is my error trace:

Running handlers:
       [2014-08-05T00:18:58+00:00] ERROR: Running exception handlers
         Running handlers complete

       [2014-08-05T00:18:58+00:00] ERROR: Exception handlers complete
       [2014-08-05T00:18:58+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
         Chef Client failed. 10 resources updated in 156.207725987 seconds
       [2014-08-05T00:18:58+00:00] ERROR: chef_gem[pg] (postgresql::ruby line 58) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
       ---- Begin output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
       STDOUT: Building native extensions.  This could take a while...
       STDERR: ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

        /opt/chef/embedded/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=/opt/chef/embedded/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
        --with-pqlib
        --without-pqlib
        --with-libpqlib
        --without-libpqlib
        --with-ms/libpqlib
        --without-ms/libpqlib


       Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1 for inspection.
       Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1/ext/gem_make.out
       ---- End output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
       Ran /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" returned 1
       [2014-08-05T00:18:58+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Here is where it fails: Can't find the PostgreSQL client library (libpq)

from postgresql.

phpPhil avatar phpPhil commented on July 30, 2024

This is based on masterchef's finding and provides a workaround for the time being.
Add to your recipe before postgresql::ruby is called:

apt_package "ruby1.9.1-dev" do
  action :nothing
end.run_action(:install)

Consider putting the version number into attributes as well.

from postgresql.

alambike avatar alambike commented on July 30, 2024

Same issue here, solved downgrading chef client to 11.16.2.
Seems that the workaround to bug COOK-1406 isn't working with latest chef version, in omnibus install

Sorry, it's my fault, with a clean installation of both official versions works ok. I was using an omnibus custom installation which has the issue.

from postgresql.

slyness avatar slyness commented on July 30, 2024

building pg gem is not longer a problem.

from postgresql.

lock avatar lock commented on July 30, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from postgresql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.