You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error installing REE 1.8.7-2009.10 — ossl.c:119:1: error: unknown type name ‘STACK’ #445
I'm trying to use this bad-ass tool to install REE 1.8.7-2009.10 (don't ask!) on our Ubuntu 13.04 Jenkins CI server. I appreciate that this Ruby version is mega-old, but I'm seriously stuck with trying to get it to compile and wondered if anyone had any clues?
I've cleared a couple of hurdles so far, but stumbled on the third. Here's where I've managed to get up to:
jenkins@jenkins:~$ export CONFIGURE_OPTS="--no-tcmalloc -c --with-readline=/usr/share/readline"
jenkins@jenkins:~$ rbenv install ree-1.8.7-2009.10
Downloading ruby-enterprise-1.8.7-2009.10.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/3727eef7b6b1b2f31db7d091328d966e
Installing ruby-enterprise-1.8.7-2009.10...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20131104122418.19336
Results logged to /tmp/ruby-build.20131104122418.19336.log
Last 10 log lines:
ossl_x509crl.c: In function‘ossl_x509crl_get_revoked’:
ossl_x509crl.c:265:11: warning: pointer type mismatch in conditional expression [enabled by default]
ossl_x509crl.c:273:24: warning: pointer type mismatch in conditional expression [enabled by default]
/usr/bin/gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -I/var/lib/jenkins/.rbenv/versions/ree-1.8.7-2009.10/include -I/var/lib/jenkins/.rbenv/versions/ree-1.8.7-2009.10/include -fPIC -g -Os -fno-strict-aliasing -c ossl.c
ossl.c:118:1: error: unknown type name ‘STACK’
ossl.c:119:1: error: unknown type name ‘STACK’
make[1]: *** [ossl.o] Error 1
make[1]: Leaving directory `/tmp/ruby-build.20131104122418.19336/ruby-enterprise-1.8.7-2009.10/source/ext/openssl'make: *** [all] Error 1
I have libssl-dev installed, and /usr/include/openssl/stack.h is present, but I just can't figure out how to get it recognised (if that's even the right answer!)
I can compile other rubies OK (e.g., 2.0.0-p247 is running like a dream). I found some solutions for RVM, but nothing for rbenv / ruby-build. Any ideas how I might get past this problem?
From what I quickly looked up for you, it seems that this is a problem of the OpenSSL version (1.0.1) shipping with systems nowadays being too new for that ancient version of Ruby. You need to patch Ruby.
The way you do what with ruby-build right now is to save the following as a file e.g. my-ree-patched:
Wowzer! Thanks so much for the detailed help. I followed those steps, they seemed to be successful and now I have a different error 😉
# ...snip...
Hunk #1 succeeded at 262 (offset -2 lines).
Hunk #2 succeeded at 270 (offset -2 lines).
Installing ruby-enterprise-1.8.7-2009.10...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20131104135531.31271
Results logged to /tmp/ruby-build.20131104135531.31271.log
Last 10 log lines:
ossl_ssl.c:111:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:111:5: warning: (near initialization for ‘ossl_ssl_method_tab[10].func’) [enabled by default]
ossl_ssl.c:112:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:112:5: warning: (near initialization for ‘ossl_ssl_method_tab[11].func’) [enabled by default]
ossl_ssl.c: In function ‘ossl_ssl_get_cipher’:
ossl_ssl.c:1224:12: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
make[1]: *** [ossl_ssl.o] Error 1
make[1]: Leaving directory `/tmp/ruby-build.20131104135531.31271/ruby-enterprise-1.8.7-2009.10/source/ext/openssl'
make: *** [all] Error 1
...but the installation finished OK, I can run ruby -v and get the correct version, and it only blows up when I try to use a socket. There's lots of stuff hinting to recompiling cURL, so I think this must be way outside the remit of ruby-build. Thank you so much for your time & being ridiculously helpful! I owe you a 🍺!
That's no good :( Ideally you wouldn't have such issues. Also, to my knowledge Ruby doesn't ship with bindings to libcurl, but that might be a REE thing that I'm not aware of.
Activity
mislav commentedon Nov 4, 2013
From what I quickly looked up for you, it seems that this is a problem of the OpenSSL version (1.0.1) shipping with systems nowadays being too new for that ancient version of Ruby. You need to patch Ruby.
The way you do what with ruby-build right now is to save the following as a file e.g.
my-ree-patched:And then:
$ rbenv install /path/to/my-ree-patched # or, if you're using ruby-build directly: $ ruby-build /path/to/my-ree-patched /path/to/installCan you try that and let me know if it works?
rwrrll commentedon Nov 4, 2013
Wowzer! Thanks so much for the detailed help. I followed those steps, they seemed to be successful and now I have a different error 😉
mislav commentedon Nov 4, 2013
Seems like you need to apply one more patch. I'm tapping in the dark here, try if this helps you. Add another patch line:
This is related to #75 and http://bugs.ruby-lang.org/issues/4556
rwrrll commentedon Nov 4, 2013
Dude, thank you so much. You're a wizard! Ruby compiles now. I do get this error:
...but the installation finished OK, I can run
ruby -vand get the correct version, and it only blows up when I try to use a socket. There's lots of stuff hinting to recompiling cURL, so I think this must be way outside the remit ofruby-build. Thank you so much for your time & being ridiculously helpful! I owe you a 🍺!mislav commentedon Nov 4, 2013
I'm just good at googling :)
That's no good :( Ideally you wouldn't have such issues. Also, to my knowledge Ruby doesn't ship with bindings to libcurl, but that might be a REE thing that I'm not aware of.
ganar commentedon Oct 2, 2015
@mislav your contribution is a godsend!
I want it to add that this also works with RVM in a simpler way and without errors. In my case it was
rvm install ruby-1.8.7-p249 --patch https://github.com/wayneeseguin/rvm/raw/187ab4c/patches/ree/1.8.6/openssl-1.0.patch --patch https://github.com/wayneeseguin/rvm/raw/187ab4cc/patches/ree/1.8.7/no_sslv2.diffyour second patch gave me the following result during installation
Patch no_sslv2 was already applied.specialforest commentedon Sep 7, 2016
I combined both patches into a single one to be used with rbenv - https://gist.github.com/specialforest/d74b772eda5058a0f680f52d6e75bc4e/raw/004b9a457a92640d62b67a4828c6a7dd3c616d50/ruby-1.8.7.patch
cat ruby-1.8.7.patch | rbenv -p install 1.8.7
Successfully built Ruby 1.8.7 on Ubuntu 16.04.