Skip to content

Instantly share code, notes, and snippets.

@jc00ke
Last active June 28, 2019 22:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jc00ke/d696299b4cb74772dde356cc23273bce to your computer and use it in GitHub Desktop.
Save jc00ke/d696299b4cb74772dde356cc23273bce to your computer and use it in GitHub Desktop.
Install Ruby 2.3.1 on Manjaro Linux
$> sudo pacman -S gcc5 openssl-1.0
$> CC=gcc-5 CXX=g++-5 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig/:/usr/lib/pkgconfig/RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr
/lib/openssl-1.0/ asdf install ruby 2.3.1

Detailed steps

$> bash
$> sudo pacman -S gcc5 openssl-1.0
$> CC=gcc-5 CXX=g++-5 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig/:/usr/lib/pkgconfig/RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr
/lib/openssl-1.0/ asdf install ruby 2.3.5
@jc00ke
Copy link
Author

jc00ke commented Jun 28, 2018

Ignore OpenSSL broken by Apple.
Please use another openssl. (e.g. using `configure --with-openssl-dir=/path/to/openssl')
Failed to configure openssl. It will not be installed.

🤷‍♂️

@jc00ke
Copy link
Author

jc00ke commented Jun 28, 2018

current directory: /home/jesse/.asdf/installs/ruby/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.3.0/ext/puma_http11
/home/jesse/.asdf/installs/ruby/2.3.1/bin/ruby -r ./siteconf20180627-10075-mc16is.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/jesse/.asdf/installs/ruby/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/puma-3.3.0/mkmf.log

current directory: /home/jesse/.asdf/installs/ruby/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.3.0/ext/puma_http11
make "DESTDIR=" clean

current directory: /home/jesse/.asdf/installs/ruby/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.3.0/ext/puma_http11
make "DESTDIR="
compiling mini_ssl.c
mini_ssl.c: In function ‘get_dh1024’:
mini_ssl.c:90:5: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
   dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
     ^~
mini_ssl.c: In function ‘engine_init_server’:
mini_ssl.c:161:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   DH *dh = get_dh1024();
   ^~
mini_ssl.c:165:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_secp521r1);
   ^~~~~~
mini_ssl.c: In function ‘engine_init_client’:
mini_ssl.c:192:3: warning: ‘DTLSv1_method’ is deprecated [-Wdeprecated-declarations]
   conn->ctx = SSL_CTX_new(DTLSv1_method());
   ^~~~
In file included from /usr/include/openssl/ct.h:13:0,
                 from /usr/include/openssl/ssl.h:61,
                 from mini_ssl.c:15:
/usr/include/openssl/ssl.h:1645:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_method(void)) /* DTLSv1.0 */
 ^
make: *** [Makefile:239: mini_ssl.o] Error 1

make failed, exit code 2

@jc00ke
Copy link
Author

jc00ke commented Jun 28, 2018

  • download openssl 1.0.1f
  • ./config --openssldir=/usr/lib/openssl-1.0.1f
  • comment out install rule with install_docs and make it just install: all install_sw
  • make
  • sudo make install

@jc00ke
Copy link
Author

jc00ke commented Jun 28, 2018

@jc00ke
Copy link
Author

jc00ke commented Jul 6, 2018

> ruby-install --install-dir ~/.asdf/installs/ruby/2.3.1/ ruby 2.3.1 -- CC=gcc-6 --with-openssl-dir=$HOME/opt/libressl/

Download the correct version of LibreSSL then follow directions to install.
This won't actually install OpenSSL module successfully, so then go download the .gem file from Rubygems and install locally

> gem install -l ~/Downloads/openssl-2.1.1.gem -- --with-openssl-dir=$HOME/opt/libressl/lib/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment