rbenv安装Ruby2.3.5报错BUILD FAILED (Ubuntu 18.04 using ruby-build 20191225-1-gbac1f1c) openssl

简介: rbenv安装Ruby2.3.5报错BUILD FAILED (Ubuntu 18.04 using ruby-build 20191225-1-gbac1f1c) openssl

1、错误全貌


vagrant@vagrant:~$ rbenv install 2.3.5
Downloading ruby-2.3.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.bz2
Installing ruby-2.3.5...
BUILD FAILED (Ubuntu 18.04 using ruby-build 20191225-1-gbac1f1c)
Inspect or clean up the working tree at /tmp/ruby-build.20200110024455.7699.rhd7DZ
Results logged to /tmp/ruby-build.20200110024455.7699.log
Last 10 log lines:
ossl_pkey.h:45:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
ossl_pkey.h:45:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
Makefile:301: recipe for target 'ossl_config.o' failed
make[2]: *** [ossl_config.o] Error 1
make[2]: Leaving directory '/tmp/ruby-build.20200110024455.7699.rhd7DZ/ruby-2.3.5/ext/openssl'
exts.mk:212: recipe for target 'ext/openssl/all' failed
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory '/tmp/ruby-build.20200110024455.7699.rhd7DZ/ruby-2.3.5'
uncommon.mk:203: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2


自己下载ruby-2.3.5.tar.gz文件,用make进行源安装,还是报错


openssl_missing.h:78:35: error: macro "EVP_MD_CTX_create" passed 1 arguments,but takes just 0
 EVP_MD_CTX *EVP_MD_CTX_create(void);
                                   ^
In file included from /usr/include/openssl/x509.h:23:0,from /usr/include/openssl/x509_vfy.h:17,from openssl_missing.c:15:
openssl_missing.h:82:6: error: expected declaration specifiers or ‘...’ before ‘(’ token
 void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
      ^
openssl_missing.h:90:6: error: expected declaration specifiers or ‘...’ before ‘(’ token
 void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
      ^
openssl_missing.c:39:23: error: macro "EVP_MD_CTX_create" passed 1 arguments,but takes just 0
 EVP_MD_CTX_create(void)
                       ^
openssl_missing.c:40:1: error: expected ‘=’,‘,’,‘;’,‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
openssl_missing.c: In function ‘EVP_MD_CTX_cleanup’:
openssl_missing.c:55:27: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX {aka struct evp_md_ctx_st}’
     memset(ctx,sizeof(EVP_MD_CTX));
                           ^~~~~~~~~~
In file included from /usr/include/openssl/x509.h:23:0,from openssl_missing.c:15:
openssl_missing.c: At top level:
openssl_missing.c:63:1: error: expected declaration specifiers or ‘...’ before ‘(’ token
 EVP_MD_CTX_destroy(EVP_MD_CTX *ctx)
 ^
openssl_missing.c:72:1: error: expected declaration specifiers or ‘...’ before ‘(’ token
 EVP_MD_CTX_init(EVP_MD_CTX *ctx)
 ^
openssl_missing.c: In function ‘HMAC_CTX_init’:
openssl_missing.c:82:25: error: dereferencing pointer to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
     EVP_MD_CTX_init(&ctx->i_ctx);
                         ^
openssl_missing.c: In function ‘HMAC_CTX_cleanup’:
openssl_missing.c:95:27: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
     memset(ctx,sizeof(HMAC_CTX));
                           ^~~~~~~~
Makefile:301: recipe for target 'openssl_missing.o' failed
make[2]: *** [openssl_missing.o] Error 1
make[2]: Leaving directory '/home/gabriel/Downloads/ruby-2.3.7/ext/openssl'
exts.mk:212: recipe for target 'ext/openssl/all' failed
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory '/home/gabriel/Downloads/ruby-2.3.7'
uncommon.mk:203: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2


2、解决方法


运行下面这条语句,安装libssl-dev和libssl1.0-dev依赖包


sudo apt purge libssl-dev && sudo apt install libssl1.0-dev


再运行rbenv install 2.3.5就可以安装成功了


如果网络太慢,运行rbenv install 2.3.5总是卡在下载ruby安装文件这一步上,可以试试下面的方法 解决rbenv install安装过慢的问题

目录
相关文章
|
29天前
|
并行计算 Ubuntu Linux
Ubuntu学习笔记(五):18.04安装多版本CUDA
这篇博客文章介绍了在Ubuntu 18.04系统上如何安装和切换不同版本的CUDA,以及如何安装不同版本的cuDNN。
149 2
|
29天前
|
并行计算 PyTorch TensorFlow
Ubuntu安装笔记(一):安装显卡驱动、cuda/cudnn、Anaconda、Pytorch、Tensorflow、Opencv、Visdom、FFMPEG、卸载一些不必要的预装软件
这篇文章是关于如何在Ubuntu操作系统上安装显卡驱动、CUDA、CUDNN、Anaconda、PyTorch、TensorFlow、OpenCV、FFMPEG以及卸载不必要的预装软件的详细指南。
2587 3
|
23天前
|
Ubuntu Linux 测试技术
Linux系统之Ubuntu安装cockpit管理工具
【10月更文挑战第13天】Linux系统之Ubuntu安装cockpit管理工具
79 4
Linux系统之Ubuntu安装cockpit管理工具
|
28天前
|
Ubuntu 应用服务中间件 nginx
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
本文是关于Ubuntu系统中使用ffmpeg 3.2.16源码编译OpenCV 3.4.0的安装笔记,包括安装ffmpeg、编译OpenCV、卸载OpenCV以及常见报错处理。
117 2
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
|
28天前
|
Ubuntu Linux C语言
Ubuntu安装笔记(二):ubuntu18.04编译安装opencv 3.4.0 opencv_contrib3.4.0
本文介绍了在Ubuntu 18.04系统上编译安装OpenCV 3.4.0及其扩展包opencv_contrib 3.4.0的详细步骤,包括下载源码、安装依赖、配置CMake和编译安装,以及常见问题的解决方法。
70 1
Ubuntu安装笔记(二):ubuntu18.04编译安装opencv 3.4.0 opencv_contrib3.4.0
|
29天前
|
Ubuntu 虚拟化
软件安装(二):VMware ubuntu20.04 安装步骤
这篇文章是关于如何在VMware Workstation 16 Player上安装Ubuntu 20.04桌面版的详细步骤指南。
144 2
软件安装(二):VMware ubuntu20.04 安装步骤
|
24天前
|
Kubernetes Ubuntu Docker
从0开始搞K8S:使用Ubuntu进行安装(环境安装)
通过上述步骤,你已经在Ubuntu上成功搭建了一个基本的Kubernetes单节点集群。这只是开始,Kubernetes的世界广阔且深邃,接下来你可以尝试部署应用、了解Kubernetes的高级概念如Services、Deployments、Ingress等,以及探索如何利用Helm等工具进行应用管理,逐步提升你的Kubernetes技能树。记住,实践是最好的老师,不断实验与学习,你将逐渐掌握这一强大的容器编排技术。
79 1
|
28天前
|
Ubuntu Linux
软件安装(五):Ubuntu 18.04安装Teamviewer 看一遍就会
这篇文章介绍了在Ubuntu 18.04系统上通过图形界面和命令行两种方法安装TeamViewer远程控制软件的步骤。
26 2
|
10天前
|
消息中间件 Ubuntu Java
Ubuntu系统上安装Apache Kafka
Ubuntu系统上安装Apache Kafka
|
16天前
|
Ubuntu Linux
Ubuntu 16.04下无法安装.deb的解决方法
希望以上策略能有效协助您克服在Ubuntu 16.04中安装.deb文件时遇到的挑战。
16 0
下一篇
无影云桌面