The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cannot install required gem "pg" on cPanel

Discussion in 'General Discussion' started by furquan, Mar 25, 2012.

  1. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    425
    Likes Received:
    0
    Trophy Points:
    16
    Hello All,

    I am trying to install a gem by the name of"pg" on my cPanel server.

    I have tried installing it via WHM and SSH and users cPanel interface, but in vein.

    Every time I try I get this following error :-

    Can any one on board assist me with this ?

    Thank you,
     
  2. minosjl

    minosjl Well-Known Member

    Joined:
    Jun 4, 2011
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Whats happening if you execute the command "gem install pg " in the shell. Paste the error.

    Thank you
     
  3. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    425
    Likes Received:
    0
    Trophy Points:
    16
    Hello ,

    The message that I have pasted above is what I see when I run "gem install pg" from command line :(
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Do you have PostgreSQL installed by using "/usr/local/cpanel/scripts/installpostgres" on the machine? You have to have PostgreSQL installed in order to install anything that requires it. I didn't have PostgreSQL installed and I was unable to install pg. After I installed it, it was still failing so I had to revert my Ruby installation and reinstall it for some reason. After I did, I checked that the postgresql rpms existed and then was able to install it:

    Code:
    root@host [~]# rpm -qa | grep -i postgres
    postgresql-devel-8.4.9-1.el6_1.1.i686
    postgresql-libs-8.4.9-1.el6_1.1.i686
    postgresql-server-8.4.9-1.el6_1.1.i686
    postgresql-8.4.9-1.el6_1.1.i686
    Code:
    root@host [~]# gem install pg
    Fetching: pg-0.13.2.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed pg-0.13.2
    1 gem installed
    Installing ri documentation for pg-0.13.2...
    
    Enclosing class/module 'rb_mPG' for class Connection not known
    
    Enclosing class/module 'rb_mPG' for class Result not known
    Installing RDoc documentation for pg-0.13.2...
    
    Enclosing class/module 'rb_mPG' for class Connection not known
    
    Enclosing class/module 'rb_mPG' for class Result not known
    The ri and RDoc failures are simply documentation warnings. They would be harmless warnings. The module does successfully install.

    Of note, if you have a failure like existed, you'd normally want to search online for the error message where you'll find mention of the postgresql-devel headers being required for the component. When you haven't installed PostgreSQL using cPanel, you won't have the rpm that is needed, which causes the failure.
     
  5. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    425
    Likes Received:
    0
    Trophy Points:
    16
    Hello All !

    I finally manged to get this solved, But not with out the help of cPanels wonderful staff "Tracey Clark" :)

    First, had to check the logs located at :-

    /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/mkmf.log

    This is what we see :-

    As the original output suggests, We were receiving this error because the system is missing a dependency of the gem. If we do a web search on "undefined reference to `PQconnectionUsedPassword'" we will find more information about this error. We can work around this error by telling gem to also include dependencies with:


    It still runs into a problem with PostgreSQL being too old to support the version of this gem that we had specified.
    We had to go though this url to upgrade our version of PostgreSQL :


    Installing or Updating PostgreSQL on Your cPanel & WHM Server


    Hope this helps some one :)
     
Loading...

Share This Page