简体   繁体   中英

How to use rbenv to install Ruby 2.5.1

I am trying to install Ruby and rbenv but I keep running into errors. I tried researching solutions here and attempted several but did not have success.

Whenever I attempt to download I get:

Downloading ruby-2.5.1.tar.bz2...

-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2
Installing ruby-2.5.1...
ruby-build: using readline from homebrew

BUILD FAILED (OS X 10.15.4 using ruby-build 20200401)

Inspect or clean up the working tree at /var/folders/7s/2q_70_3x7qj4q2gx60mp2lw00000gn/T/ruby-build.20200409195302.36573.PF8HnQ
Results logged to /var/folders/7s/2q_70_3x7qj4q2gx60mp2lw00000gn/T/ruby-build.20200409195302.36573.log

Last 10 log lines:
The Ruby yaml extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
  --prefix=/Users/shanellevalencia/.rbenv/versions/2.5.1
  --with-openssl-dir=/Users/shanellevalencia/.rbenv/versions/2.5.1/openssl
  --enable-shared
  --with-readline-dir=/usr/local/opt/readline
  CC=clang`enter code here
  LDFLAGS=-L/Users/shanellevalencia/.rbenv/versions/2.5.1/lib 
  CPPFLAGS=-I/Users/shanellevalencia/.rbenv/versions/2.5.1/include 
Shanelles-MacBook-Pro:~ shanellevalencia$ 

you should be installing latest stable ruby version 2.7 in your machine instead of old versions.

This is a great tutorial for installing ruby using rbenv: https://linuxize.com/post/how-to-install-ruby-on-ubuntu-18-04/#installing-ruby-using-rbenv

I hope it helps. Let me know if you get stuck anywhere and need any help, I will be glad to support you in any way I can.

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