2

I'm trying to install Ruby 1.9.2 on CentOS 5.5. I get through most of the make process, but when it tries to compile OpenSSL I get an error. Below is the errror outputted:

compiling openssl
make[1]: Entering directory `/sources/ruby-1.9.2-p136/ext/openssl'
gcc -I. -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -o ossl_x509.o -c ossl_x509.c
In file included from ossl.h:201,
                 from ossl_x509.c:11:
openssl_missing.h:71: error: conflicting types for ‘HMAC_CTX_copy’
/usr/include/openssl/hmac.h:102: error: previous declaration of ‘HMAC_CTX_copy’ was here
openssl_missing.h:95: error: conflicting types for ‘EVP_CIPHER_CTX_copy’
/usr/include/openssl/evp.h:459: error: previous declaration of ‘EVP_CIPHER_CTX_copy’ was here
make[1]: *** [ossl_x509.o] Error 1
make[1]: Leaving directory `/sources/ruby-1.9.2-p136/ext/openssl'
make: *** [mkmain.sh] Error 1

Any help would be greatly appreciated! I'm not a master at Linux by any means, but I was able to successfully install this version of Ruby on our dev server. Our live server is running a newer version of OpenSSL which I'm assuming is why it's breaking. Just not sure what the fix is!

pstinnett
  • 21
  • 3
  • Have a look at [this question](http://stackoverflow.com/questions/3242486/compiling-openssl-with-ruby-on-windows) on Stack Overflow which gives some information. – user9517 Feb 25 '11 at 17:06
  • Thanks, but it seems like that's trying to solve the problem for Windows, and the solution is using a Windows ruby installer script. I think the problem may just be that someone installed a new version of openssl on this server and I'm not pointing the configure script at the right place... – pstinnett Feb 25 '11 at 18:08

1 Answers1

0

I googled a little, and found a blog post on Installing Ruby 1.9 on CentOS. I've only installed Ruby via source on CentOS once or twice, and that's been over a year ago, but I would highly recommend doing all you can with the CentOS package manager (yum) first - such as install openssl and openssl-devel with yum, like this:

yum install openssl openssl-devel

Hope this helps, David

David W
  • 3,453
  • 5
  • 36
  • 62
  • Hi David, thanks for your response. Unfortunately CentOS's package manager (yum) doesn't really keep up-to-date packages. For PCI-Compliance issues our server needs to run OpenSSL 1.0.0c, but I believe the latest version that can be installed via yum is 0.0.98. I'm guessing our manual install of OpenSSL is catching up Ruby, but I'm not 100% sure. – pstinnett Feb 27 '11 at 04:02
  • What is the issue with PCI compliance that requires 1.0.0c rather than the back-ported fixes Red Hat has made to OpenSSL 0.9.8e? – Mark Wagner May 02 '11 at 23:56
  • 1
    This my huge pet peeve of mine. For some reason, a number of PCI Vendors could not distinguish between packages from the original sources and vendor sources (e.g. Red Hat). Vendor sources are usually not current from a feature standpoint but they DO backport security updates. That is why Red Hat (and CentOS, which is derived from Red Hat) is so popular in Enterprise - customers can count on them to get updates without having applications break. A competent PCI vendor would understand this and take that into account. If not, something is seriously wrong here. . . – Rilindo Sep 18 '11 at 19:33
  • @pstinnett You could investigate using different yum repos - there may be one out there that uses the version of OpenSSL that you need. Otherwise you are going to have to figure out how to handle dependencies when building from source - a basic skill for any sysadmin. – dunxd Mar 19 '13 at 10:23