{"action":"created","issue":{"url":"https://api.github.com/repos/hw-cookbooks/postgresql/issues/203","repository_url":"https://api.github.com/repos/hw-cookbooks/postgresql","labels_url":"https://api.github.com/repos/hw-cookbooks/postgresql/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/hw-cookbooks/postgresql/issues/203/comments","events_url":"https://api.github.com/repos/hw-cookbooks/postgresql/issues/203/events","html_url":"https://github.com/hw-cookbooks/postgresql/issues/203","id":46921443,"number":203,"title":"postgresql::ruby - chef_gem[pg] install fails on missing gcc (Amazon Linux)","user":{"login":"eric-tucker","id":2693414,"avatar_url":"https://avatars.githubusercontent.com/u/2693414?v=3","gravatar_id":"","url":"https://api.github.com/users/eric-tucker","html_url":"https://github.com/eric-tucker","followers_url":"https://api.github.com/users/eric-tucker/followers","following_url":"https://api.github.com/users/eric-tucker/following{/other_user}","gists_url":"https://api.github.com/users/eric-tucker/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-tucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-tucker/subscriptions","organizations_url":"https://api.github.com/users/eric-tucker/orgs","repos_url":"https://api.github.com/users/eric-tucker/repos","events_url":"https://api.github.com/users/eric-tucker/events{/privacy}","received_events_url":"https://api.github.com/users/eric-tucker/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2014-10-27T15:47:08Z","updated_at":"2016-10-06T03:15:28Z","closed_at":"2016-10-06T03:15:19Z","body":"Manually installing gcc makes the cookbook work again.\r\n\r\nStacktrace from failed run:\r\n\r\n````\r\nCompiling Cookbooks...\r\n[2014-10-27T15:37:48+00:00] INFO: WindowsPackage lightweight resource already initialized -- overriding!\r\nRecipe: postgresql::client\r\n  * package[postgresql-devel] action install[2014-10-27T15:37:49+00:00] INFO: Processing package[postgresql-devel] action install (postgresql::client line 31)\r\n (up to date)\r\nRecipe: postgresql::ruby\r\n  * chef_gem[pg] action install[2014-10-27T15:37:58+00:00] INFO: Processing chef_gem[pg] action install (postgresql::ruby line 55)\r\n\r\n    \r\n    ================================================================================\r\n    Error executing action `install` on resource 'chef_gem[pg]'\r\n    ================================================================================\r\n    \r\n    Mixlib::ShellOut::ShellCommandFailed\r\n    ------------------------------------\r\n    Expected process to exit with [0], but received '1'\r\n    ---- Begin output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v \"0.17.1\" ----\r\n    STDOUT: Building native extensions.  This could take a while...\r\n    STDERR: ERROR:  Error installing pg:\r\n        ERROR: Failed to build gem native extension.\r\n    \r\n            /opt/chef/embedded/bin/ruby extconf.rb\r\n    checking for pg_config... yes\r\n    Using config values from /usr/bin/pg_config\r\n    checking for libpq-fe.h... *** extconf.rb failed ***\r\n    Could not create Makefile due to some reason, probably lack of\r\n    necessary libraries and/or headers.  Check the mkmf.log file for more\r\n    details.  You may need configuration options.\r\n    \r\n    Provided configuration options:\r\n        --with-opt-dir\r\n        --with-opt-include\r\n        --without-opt-include=${opt-dir}/include\r\n        --with-opt-lib\r\n        --without-opt-lib=${opt-dir}/lib\r\n        --with-make-prog\r\n        --without-make-prog\r\n        --srcdir=.\r\n        --curdir\r\n        --ruby=/opt/chef/embedded/bin/ruby\r\n        --with-pg\r\n        --without-pg\r\n        --with-pg-config\r\n        --without-pg-config\r\n        --with-pg_config\r\n        --without-pg_config\r\n        --with-pg-dir\r\n        --without-pg-dir\r\n        --with-pg-include\r\n        --without-pg-include=${pg-dir}/include\r\n        --with-pg-lib\r\n        --without-pg-lib=${pg-dir}/lib\r\n    /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)\r\n    You have to install development tools first.\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:983:in `block in find_header'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:254:in `open'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:254:in `open'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:982:in `find_header'\r\n        from extconf.rb:48:in `<main>'\r\n    \r\n    \r\n    Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1 for inspection.\r\n    Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1/ext/gem_make.out\r\n    ---- End output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v \"0.17.1\" ----\r\n    Ran /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v \"0.17.1\" returned 1\r\n    \r\n    Cookbook Trace:\r\n    ---------------\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:55:in `rescue in from_file'\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:21:in `from_file'\r\n    /var/chef/cache/cookbooks/database/recipes/postgresql.rb:20:in `from_file'\r\n    \r\n    Resource Declaration:\r\n    ---------------------\r\n    # In /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb\r\n    \r\n     55:     chef_gem \"pg\"\r\n     56:   rescue Gem::Installer::ExtensionBuildError, Mixlib::ShellOut::ShellCommandFailed => e\r\n    \r\n    Compiled Resource:\r\n    ------------------\r\n    # Declared in /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:55:in `rescue in from_file'\r\n    \r\n    chef_gem(\"pg\") do\r\n      provider Chef::Provider::Package::Rubygems\r\n      action :install\r\n      retries 0\r\n      retry_delay 2\r\n      guard_interpreter :default\r\n      package_name \"pg\"\r\n      version \"0.17.1\"\r\n      timeout 900\r\n      gem_binary \"/opt/chef/embedded/bin/gem\"\r\n      cookbook_name \"postgresql\"\r\n      recipe_name \"ruby\"\r\n    end\r\n    \r\n[2014-10-27T15:38:03+00:00] WARN: Failed to properly build pg gem. Forcing properly linking and retrying (omnibus fix)\r\n  * execute[generate pg gem Makefile] action run[2014-10-27T15:38:03+00:00] INFO: Processing execute[generate pg gem Makefile] action run (postgresql::ruby line 86)\r\n\r\n    \r\n    ================================================================================\r\n    Error executing action `run` on resource 'execute[generate pg gem Makefile]'\r\n    ================================================================================\r\n    \r\n    Mixlib::ShellOut::ShellCommandFailed\r\n    ------------------------------------\r\n    Expected process to exit with [0], but received '1'\r\n    ---- Begin output of PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb ----\r\n    STDOUT: checking for pg_config... yes\r\n    STDERR: Using config values from /usr/bin/pg_config\r\n    *** extconf.rb failed ***\r\n    Could not create Makefile due to some reason, probably lack of\r\n    necessary libraries and/or headers.  Check the mkmf.log file for more\r\n    details.  You may need configuration options.\r\n    \r\n    Provided configuration options:\r\n        --with-opt-dir\r\n        --with-opt-include\r\n        --without-opt-include=${opt-dir}/include\r\n        --with-opt-lib\r\n        --without-opt-lib=${opt-dir}/lib\r\n        --with-make-prog\r\n        --without-make-prog\r\n        --srcdir=.\r\n        --curdir\r\n        --ruby=/opt/chef/embedded/bin/ruby\r\n        --with-pg\r\n        --without-pg\r\n        --with-pg-config\r\n        --without-pg-config\r\n        --with-pg_config\r\n        --without-pg_config\r\n        --with-pg-dir\r\n        --without-pg-dir\r\n        --with-pg-include\r\n        --without-pg-include=${pg-dir}/include\r\n        --with-pg-lib\r\n        --without-pg-lib=${pg-dir}/lib\r\n    /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)\r\n    You have to install development tools first.\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'\r\n        from extconf.rb:52:in `<main>'\r\n    ---- End output of PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb ----\r\n    Ran PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb returned 1\r\n    \r\n    Cookbook Trace:\r\n    ---------------\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:92:in `rescue in rescue in from_file'\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:54:in `rescue in from_file'\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:21:in `from_file'\r\n    /var/chef/cache/cookbooks/database/recipes/postgresql.rb:20:in `from_file'\r\n    \r\n    Resource Declaration:\r\n    ---------------------\r\n    # In /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb\r\n    \r\n     86:     lib_builder = execute 'generate pg gem Makefile' do\r\n     87:       # [COOK-3490] pg gem install requires full path on RHEL\r\n     88:       command \"PATH=$PATH:/usr/pgsql-#{node['postgresql']['version']}/bin #{RbConfig.ruby} extconf.rb\"\r\n     89:       cwd ext_dir\r\n     90:       action :nothing\r\n     91:     end\r\n     92:     lib_builder.run_action(:run)\r\n    \r\n    Compiled Resource:\r\n    ------------------\r\n    # Declared in /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:86:in `rescue in rescue in from_file'\r\n    \r\n    execute(\"generate pg gem Makefile\") do\r\n      action [:nothing]\r\n      retries 0\r\n      retry_delay 2\r\n      guard_interpreter :default\r\n      command \"PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb\"\r\n      backup 5\r\n      cwd \"/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1/ext\"\r\n      returns 0\r\n      cookbook_name \"postgresql\"\r\n      recipe_name \"ruby\"\r\n    end\r\n    \r\n  \r\n  ================================================================================\r\n  Recipe Compile Error in /var/chef/cache/cookbooks/database/recipes/postgresql.rb\r\n  ================================================================================\r\n  \r\n  Mixlib::ShellOut::ShellCommandFailed\r\n  ------------------------------------\r\n  execute[generate pg gem Makefile] (postgresql::ruby line 86) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'\r\n  ---- Begin output of PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb ----\r\n  STDOUT: checking for pg_config... yes\r\n  STDERR: Using config values from /usr/bin/pg_config\r\n  *** extconf.rb failed ***\r\n  Could not create Makefile due to some reason, probably lack of\r\n  necessary libraries and/or headers.  Check the mkmf.log file for more\r\n  details.  You may need configuration options.\r\n  \r\n  Provided configuration options:\r\n        --with-opt-dir\r\n        --with-opt-include\r\n        --without-opt-include=${opt-dir}/include\r\n        --with-opt-lib\r\n        --without-opt-lib=${opt-dir}/lib\r\n        --with-make-prog\r\n        --without-make-prog\r\n        --srcdir=.\r\n        --curdir\r\n        --ruby=/opt/chef/embedded/bin/ruby\r\n        --with-pg\r\n        --without-pg\r\n        --with-pg-config\r\n        --without-pg-config\r\n        --with-pg_config\r\n        --without-pg_config\r\n        --with-pg-dir\r\n        --without-pg-dir\r\n        --with-pg-include\r\n        --without-pg-include=${pg-dir}/include\r\n        --with-pg-lib\r\n        --without-pg-lib=${pg-dir}/lib\r\n  /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)\r\n  You have to install development tools first.\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'\r\n        from extconf.rb:52:in `<main>'\r\n  ---- End output of PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb ----\r\n  Ran PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb returned 1\r\n  \r\n  Cookbook Trace:\r\n  ---------------\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:92:in `rescue in rescue in from_file'\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:54:in `rescue in from_file'\r\n    /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:21:in `from_file'\r\n    /var/chef/cache/cookbooks/database/recipes/postgresql.rb:20:in `from_file'\r\n  \r\n  Relevant File Content:\r\n  ----------------------\r\n  /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:\r\n  \r\n   85:  \r\n   86:      lib_builder = execute 'generate pg gem Makefile' do\r\n   87:        # [COOK-3490] pg gem install requires full path on RHEL\r\n   88:        command \"PATH=$PATH:/usr/pgsql-#{node['postgresql']['version']}/bin #{RbConfig.ruby} extconf.rb\"\r\n   89:        cwd ext_dir\r\n   90:        action :nothing\r\n   91:      end\r\n   92>>     lib_builder.run_action(:run)\r\n   93:  \r\n   94:      lib_maker = execute 'make pg gem lib' do\r\n   95:        command 'make'\r\n   96:        cwd ext_dir\r\n   97:        action :nothing\r\n   98:      end\r\n   99:      lib_maker.run_action(:run)\r\n  100:  \r\n  101:      lib_installer = execute 'install pg gem lib' do\r\n  \r\n  \r\n  Running handlers:\r\n[2014-10-27T15:38:03+00:00] ERROR: Running exception handlers\r\n  Running handlers complete\r\n[2014-10-27T15:38:03+00:00] ERROR: Exception handlers complete\r\n[2014-10-27T15:38:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out\r\n  Chef Client failed. 0 resources updated in 16.680772034 seconds\r\n[2014-10-27T15:38:03+00:00] ERROR: execute[generate pg gem Makefile] (postgresql::ruby line 86) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'\r\n---- Begin output of PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb ----\r\nSTDOUT: checking for pg_config... yes\r\nSTDERR: Using config values from /usr/bin/pg_config\r\n*** extconf.rb failed ***\r\nCould not create Makefile due to some reason, probably lack of\r\nnecessary libraries and/or headers.  Check the mkmf.log file for more\r\ndetails.  You may need configuration options.\r\n\r\nProvided configuration options:\r\n        --with-opt-dir\r\n        --with-opt-include\r\n        --without-opt-include=${opt-dir}/include\r\n        --with-opt-lib\r\n        --without-opt-lib=${opt-dir}/lib\r\n        --with-make-prog\r\n        --without-make-prog\r\n        --srcdir=.\r\n        --curdir\r\n        --ruby=/opt/chef/embedded/bin/ruby\r\n        --with-pg\r\n        --without-pg\r\n        --with-pg-config\r\n        --without-pg-config\r\n        --with-pg_config\r\n        --without-pg_config\r\n        --with-pg-dir\r\n        --without-pg-dir\r\n        --with-pg-include\r\n        --without-pg-include=${pg-dir}/include\r\n        --with-pg-lib\r\n        --without-pg-lib=${pg-dir}/lib\r\n/opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)\r\nYou have to install development tools first.\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'\r\n        from /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'\r\n        from extconf.rb:52:in `<main>'\r\n---- End output of PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb ----\r\nRan PATH=$PATH:/usr/pgsql-9.0/bin /opt/chef/embedded/bin/ruby extconf.rb returned 1\r\n[2014-10-27T15:38:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)\r\n````"},"comment":{"url":"https://api.github.com/repos/hw-cookbooks/postgresql/issues/comments/251857380","html_url":"https://github.com/hw-cookbooks/postgresql/issues/203#issuecomment-251857380","issue_url":"https://api.github.com/repos/hw-cookbooks/postgresql/issues/203","id":251857380,"user":{"login":"tas50","id":1015200,"avatar_url":"https://avatars.githubusercontent.com/u/1015200?v=3","gravatar_id":"","url":"https://api.github.com/users/tas50","html_url":"https://github.com/tas50","followers_url":"https://api.github.com/users/tas50/followers","following_url":"https://api.github.com/users/tas50/following{/other_user}","gists_url":"https://api.github.com/users/tas50/gists{/gist_id}","starred_url":"https://api.github.com/users/tas50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tas50/subscriptions","organizations_url":"https://api.github.com/users/tas50/orgs","repos_url":"https://api.github.com/users/tas50/repos","events_url":"https://api.github.com/users/tas50/events{/privacy}","received_events_url":"https://api.github.com/users/tas50/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T03:15:28Z","updated_at":"2016-10-06T03:15:28Z","body":"PR is #365  btw"}}
{"actor":{"display_login":"tas50"}}