Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Am trying to install ruby 3.2.1 using RVM. I'm getting the below error.

05:44:55 # rvm install ruby-3.2.1
Warning! PATH is not properly set up, /usr/local/rvm/gems/ruby-2.6.5/bin is not at first place.
         Usually this is caused by shell initialization files. Search for PATH=... entries.
         You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
         To fix it temporarily in this shell session run: rvm use ruby-2.6.5
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
Searching for binary rubies, this might take some time.
No binary rubies available for: oracle/6/x86_64/ruby-3.2.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for oracle.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-3.2.1, this may take a while depending on your cpu(s)...
ruby-3.2.1 - #downloading ruby-3.2.1, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19.5M  100 19.5M    0     0  20.6M      0 --:--:-- --:--:-- --:--:-- 29.5M
No checksum for downloaded archive, recording checksum in user configuration.
ruby-3.2.1 - #extracting ruby-3.2.1 to /usr/local/rvm/src/ruby-3.2.1.....
ruby-3.2.1 - #configuring..................................................................
ruby-3.2.1 - #post-configuration..
ruby-3.2.1 - #compiling.......................
Error running '__rvm_make -j4',
please read /usr/local/rvm/log/1677498306_ruby-3.2.1/make.log
There has been an error while running make. Halting the installation.

Below is the output of make.log

[2023-02-27 05:45:41] __rvm_make
__rvm_make () 
    \make "$@" || return $?
current path: /usr/local/rvm/src/ruby-3.2.1
GEM_HOME=/usr/local/rvm/gems/ruby-2.6.5
PATH=/usr/lib/oracle/12.1/client64/bin:/root/jdk1.6.0_45/bin/:/root/.nvm/versions/node/v11.13.0/bin:/usr/local/rvm/gems/ruby-2.6.5/bin:/usr/local/rvm/gems/ruby-2.6.5@global/bin:/usr/local/rvm/rubies/ruby-2.6.5/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/root/bin
GEM_PATH=/usr/local/rvm/gems/ruby-2.6.5:/usr/local/rvm/gems/ruby-2.6.5@global
command(2): __rvm_make -j4
--bash,383+ make -j4
    BASERUBY = /usr/local/rvm/rubies/ruby-2.6.5/bin/ruby --disable=gems
    CC = gcc -std=gnu99
    LD = ld
    LDSHARED = gcc -std=gnu99 -shared
    CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wno-maybe-uninitialized   -fPIC 
    XCFLAGS = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/15.0.0 
    CPPFLAGS =   
    DLDFLAGS = -Wl,-soname,libruby.so.3.2  -fstack-protector  
    SOLIBS =  -lz -lrt -lrt -lgmp -ldl -lcrypt -lm -lpthread 
    LANG = en_US.UTF-8
    LC_ALL = 
    LC_CTYPE = UTF-8
    MFLAGS = - --jobserver-fds=3,4 -j
    RUSTC = no
    YJIT_RUSTC_ARGS = --crate-name=yjit --crate-type=staticlib --edition=2021 -g -C opt-level=3 -C overflow-checks=on '--out-dir=/usr/local/rvm/src/ruby-3.2.1/yjit/target/release/' ./yjit/src/lib.rs
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
making dummy probes.h
compiling ast.c
In file included from ./include/ruby/internal/intern/class.h:24,
                 from ./include/ruby/internal/anyargs.h:76,
                 from ./include/ruby/ruby.h:27,
                 from dmydln.c:1:
./include/ruby/internal/value.h:128: error: expected declaration specifiers or '...' before numeric constantIn file included from ./include/ruby/internal/intern/class.h:24,
                 from ./include/ruby/internal/anyargs.h:76,
                 from ./include/ruby/ruby.h:27,
                 from internal.h:31,
                 from ast.c:2:

I tried the stable RVM and did rvm install ruby 3.2.1, it did not work too. The node is on OEL 6 and RVM 1.29.12 Could someone help is fixing this error and installing ruby 3.2.1

The block you posted includes a giant, blaring warning right at the top that you don't have RVM setup correctly. Did you fix that? Then even though it proceeds with the installation it reports an error by saying please read /usr/local/rvm/log/1677498306_ruby-3.2.1/make.log. Did you read the log like it said? Why didn't you include that log in this post? I have downvoted this question because This question does not show any research effort; it is unclear or not useful. I have voted to close this question because This question should include more details and clarify the problem. – anothermh Feb 28 at 8:43 I had issues with adding the logs. I've trimmed the logs so that the system let me post them – Prabhu U Feb 28 at 8:53 next few lines of the make.log In file included from ./include/ruby/internal/intern/class.h:24, from ./include/ruby/internal/anyargs.h:76, from ./include/ruby/ruby.h:27, from dmydln.c:1: ./include/ruby/internal/value.h:128: error: expected declaration specifiers or '...' before numeric constant ./include/ruby/internal/value.h:128: error: expected declaration specifiers or '...' before string constant – Prabhu U Feb 28 at 8:54

While installing the ruby on latest version of Ubuntu 22.04, I encountered a common problem when trying to install Ruby with RVM. However, I was able to resolve this issue by executing the following command:

rvm install ruby-3.2.1 -C --with-openssl-dir=/opt/local/libexec/openssl11

In case OpenSSL is not installed, you can refer to this comprehensive guide for installing Ruby version 2.7.6 on Ubuntu 22.04

The root cause of the problem stems from the fact that Ubuntu 22.04 only provides OpenSSL 3.0, which is only supported by some latest Ruby versions 3.1 and above. You can find more details on this issue on GitHub Discussion

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.