简体   繁体   中英

rbenv crashing when installing ruby binaries

I updated this Lenovo laptop to Ubuntu 22.04 LTS, installed Ruby (3.1.2), rbenv (1.1.2), then Rails (7.0.3) without issue. However, rbenv consistently crashes when I try to install new ruby executables. Thus far I've tried 2.7.2 (compatible with an old Jekyll blog) and 3.0.2. GCC 11.2.0 is being used for compilation. I've reviewed the ruby-build log but don't yet understand how to proceed.

2.7.2 compilation output shown below. Ideas?


BUILD FAILED (Ubuntu 22.04 using ruby-build 20220426-3-g1038c07)

Inspect or clean up the working tree at /tmp/ruby-build.20220526150603.174696.lPGT5x
Results logged to /tmp/ruby-build.20220526150603.174696.log

Last 10 log lines:
ripper.y: At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
linking shared-object ripper.so
make[2]: Leaving directory '/tmp/ruby-build.20220526150603.174696.lPGT5x/ruby-2.7.2/ext/ripper'
linking shared-object date_core.so
make[2]: Leaving directory '/tmp/ruby-build.20220526150603.174696.lPGT5x/ruby-2.7.2/ext/date'
make[1]: Leaving directory '/tmp/ruby-build.20220526150603.174696.lPGT5x/ruby-2.7.2'
make: *** [uncommon.mk:295: build-ext] Error 2```

安装以下依赖项( rbenv/ruby-build wiki ),然后尝试构建/安装 ruby​​。

$ apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM