0

I've tried using both Ruby Version Manager (RVM) and RBENV to install 3.0.2 and both times I get some kind of Make error, but can't make heads or tails of the log files. Here is the console log for installing with RVM

~$ rvm install 3.0.2
ruby-3.0.2 - #removing src/ruby-3.0.2..
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/22.10/x86_64/ruby-3.0.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/share/rvm/rubies/ruby-3.0.2, this may take a while depending on your cpu(s)...
ruby-3.0.2 - #downloading ruby-3.0.2, this may take a while depending on your connection...
ruby-3.0.2 - #extracting ruby-3.0.2 to /usr/share/rvm/src/ruby-3.0.2.....
ruby-3.0.2 - #configuring......................................................|
ruby-3.0.2 - #post-configuration..
ruby-3.0.2 - #compiling........................................................|
Error running '__rvm_make -j20',
please read /usr/share/rvm/log/1679415049_ruby-3.0.2/make.log

There has been an error while running make. Halting the installation.

Here is the log file from the above error https://pastebin.com/TdqPS8gm

Here is the console when installing via RBENV

~$ rbenv install 3.0.2
Downloading ruby-3.0.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz
Installing ruby-3.0.2...

BUILD FAILED (Ubuntu 22.10 using ruby-build 20220426)

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

Last 10 log lines:
linking shared-object json/ext/generator.so
linking shared-object zlib.so
make[2]: Leaving directory '/tmp/ruby-build.20230321125011.119650.C0ZjOk/ruby-3.0.2/ext/json/generator'
make[2]: Leaving directory '/tmp/ruby-build.20230321125011.119650.C0ZjOk/ruby-3.0.2/ext/zlib'
linking shared-object date_core.so
make[2]: Leaving directory '/tmp/ruby-build.20230321125011.119650.C0ZjOk/ruby-3.0.2/ext/date'
linking shared-object ripper.so
make[2]: Leaving directory '/tmp/ruby-build.20230321125011.119650.C0ZjOk/ruby-3.0.2/ext/ripper'
make[1]: Leaving directory '/tmp/ruby-build.20230321125011.119650.C0ZjOk/ruby-3.0.2'
make: *** [uncommon.mk:300: build-ext] Error 2

Here is the log file from the above error https://pastebin.com/dPe6HhtW

1 Answers1

2

You're probably following a tutorial for this. Did the tutorial told you to use Rbenv? or RVM?

You might have already tried this, but in case you have not, here is what I would do:

sudo apt install ruby-full
ruby --version

Now if you truly want to use RVM or Rbenv, you might need to review their installation. Also, you COULD TRY running this command:

sudo apt install build-essential

If it still does not work, try the above mentionned answer. Hope I could help!

Hwiparam
  • 21
  • 2
  • Thanks for your suggestion, but `sudo apt install ruby` and `ruby-full` install version 3.0.4, whereas I need 3.0.2. Running `sudo apt install build-essential` said everything was up to date, and running Rbenv and RVM both still had the same error. – CombustibleToast Mar 22 '23 at 14:56
  • Oh, sure! Run this command: ```sudo apt-get install ruby3.0=3.0.2-7ubuntu2``` I found all versions of the package ruby3.0 using this command: ```apt-cache policy ruby3.0``` In other words, to check the specific version of a package, and install the one, do this: ```apt-cache policy [package-name] && sudo apt-get install [package-name]=[version]``` Hope this helped! Have a great day. – Hwiparam Mar 22 '23 at 16:46
  • While specifying Ruby version for apt is a solution, I believe the problem lies with openssl. See here https://github.com/rbenv/ruby-build/discussions/1940 – Mike Szyndel Mar 24 '23 at 11:29