Bug 982377 - PostgreSQL cartridge should install postgresql-devel and other packages
Summary: PostgreSQL cartridge should install postgresql-devel and other packages
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Hiro Asari
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-08 20:51 UTC by Hiro Asari
Modified: 2015-05-14 23:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-22 15:22:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hiro Asari 2013-07-08 20:51:19 UTC
Description of problem:
If a Ruby app requires a 'pg' gem, in an app with PostgreSQL 8.4 cartridge, the gem cannot be created:


Version-Release number of selected component (if applicable):
devenv_3458

How reproducible:
always

Steps to Reproduce:
1. Create a bare Ruby app with PostgreSQL 8.4 cart.
    rhc app create rubyapp ruby-1.9 postgresql-8.4
2. Edit Gemfile and add 'pg'
3. Commit and push

Actual results:

Installing pg (0.15.1) with native extensions .......

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /opt/rh/ruby193/root/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.


Expected results:
gem should be built successfully.

Additional info:

Comment 1 Hiro Asari 2013-07-08 20:52:27 UTC
The following packages should be installed in all cases.

postgresql-server
postgresql-libs
postgresql-devel
postgresql-contrib
postgresql-plperl
postgresql-plpython
postgresql-pltcl

Comment 3 openshift-github-bot 2013-07-09 05:11:37 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/7e8a57675f86f9fc9c907e09f4013dce36288f8d
Bug 982377

postgresql-devel and other packages should be installed in all supported
cases. This led to a Ruby app being unable to build 'pg' gem when
PostgreSQL 8.4 (not 9.2) was embedded.

Comment 4 Meng Bo 2013-07-10 09:47:30 UTC
Checked on devenv_3471, issue has been fixed.

On server, check the psql package,
# rpm -qa|grep postgres |grep devel
postgresql-devel-8.4.13-1.el6_3.x86_64
postgresql92-postgresql-devel-9.2.4-7.el6.x86_64


Build ruby 1.9 with gem 'pg',

remote: Stopping Ruby cart
remote: httpd (no pid file) not running
remote: waiting for server to shut down.... done
remote: server stopped
remote: Postgres stopped
remote: Running build on Ruby cart
remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: Fetching gem metadata from https://rubygems.org/....
remote: Installing pg (0.12.2) with native extensions ......
remote: ..........
remote: ..
remote: 
remote: Using bundler (1.1.4) 
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Starting Postgres
remote: server starting
remote: Postgres started
remote: Starting Ruby cart
To ssh://51dd00db0ef436089300000b.rhcloud.com/~/git/ruby19.git/
   d92a44f..d3211d7  master -> master


Move bug to verified.


Note You need to log in before you can comment on or make changes to this bug.