Installing rails on ubuntu 20.04 showing BUILD FAILED error

Hello I have a fresh ubuntu 20.04 installation. now i am trying to install rails on my ubuntu and i am following this tutorials.

when i run this command, rbenv install 2.7.1 it is showing the following errors.

Downloading ruby-2.7.1.tar.bz2...
error: failed to download ruby-2.7.1.tar.bz2

BUILD FAILED (Ubuntu 20.04 using ruby-build 20200520-4-g9b7acf6)

can any one please tell me, where is the problem?

Thank you

I think you didn’t install curl. To install it run:

$ sudo apt install curl

hello, thank you for your replay. but curl is already the newest version (7.68.0-1ubuntu2).

this is strange.

I just tried installing Ruby 2.7.1 on fresh Ubuntu 20.04 install using rbenv. The only packages I needed to successfully download and build ruby are included in the following command:

$ sudo apt install gcc make curl libssl-dev zlib1g-dev

If you want more complete build environment as suggested in ruby-build wiki you can run:

$ sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses-dev libffi-dev libgdbm-dev

I modified some package names to work with Ubuntu 20.04.