rvm / ubuntu_rvm

Ubuntu package for RVM
https://launchpad.net/~rael-gc/+archive/ubuntu/rvm
Apache License 2.0
694 stars 84 forks source link

problem with ruby 2.7.7 #78

Closed andrzejsliwa closed 1 year ago

andrzejsliwa commented 1 year ago

Description

I have fresh install on ubuntu (under wsl), but installing 2.7.7 is failing with:

+ printf %b 'command(6): command gem install /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document\n'
+ rvm_log 'installing gem /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document'
+ [[ '' == 1 ]]
+ printf %b 'installing gem /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document\n'
+ command gem install /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document
ERROR:  Loading command: install (LoadError)
        cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
+ return 1
+ return 1
+ return 1
+ return 1
+ return 1

Steps to reproduce

sudo apt-get install software-properties-common
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm
sudo usermod -a -G rvm $USER
# restarting WSL under PowerShell (to solve problems with permissions)
wsl --shutdown

Installing 3.2.0

andrzejsliwa@NUC:~$ rvm install 3.2.0
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/22.04/x86_64/ruby-3.2.0.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-3.2.0 - #configure
ruby-3.2.0 - #download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 29.0M  100 29.0M    0     0  2040k      0  0:00:14  0:00:14 --:--:-- 2323k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-3.2.0 - #validate archive
ruby-3.2.0 - #extract
ruby-3.2.0 - #validate binary
ruby-3.2.0 - #setup
ruby-3.2.0 - #gemset created /usr/share/rvm/gems/ruby-3.2.0@global
ruby-3.2.0 - #importing gemset /usr/share/rvm/gemsets/global.gems..................................
ruby-3.2.0 - #generating global wrappers........
ruby-3.2.0 - #gemset created /usr/share/rvm/gems/ruby-3.2.0
ruby-3.2.0 - #importing gemsetfile /usr/share/rvm/gemsets/default.gems evaluated to empty gem list
ruby-3.2.0 - #generating default wrappers........

All Good!

Installing 2.7.7

andrzejsliwa@NUC:~$ rvm install 2.7.7
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/22.04/x86_64/ruby-2.7.7.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..andrzejsliwa password required for 'apt-get --quiet --yes update':
.
Installing required packages: libncurses5-dev, libgmp-dev, libssl-dev.......
Requirements installation successful.
ruby-2.7.7 - #configure
ruby-2.7.7 - #download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 11.3M  100 11.3M    0     0  1076k      0  0:00:10  0:00:10 --:--:-- 2004k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.7.7 - #validate archive
ruby-2.7.7 - #extract
ruby-2.7.7 - #validate binary
ruby-2.7.7 - #setup
ruby-2.7.7 - #gemset created /usr/share/rvm/gems/ruby-2.7.7@global
ruby-2.7.7 - #importing gemset /usr/share/rvm/gemsets/global.gems...............there was an error installing gem gem-wrappers
................there was an error installing gem rubygems-bundler
...............there was an error installing gem rake
.................there was an error installing gem rvm
................there was an error installing gem bundler
..
ruby-2.7.7 - #generating global wrappers...............
Error running 'run_gem_wrappers regenerate',
please read /usr/share/rvm/log/1675767030_ruby-2.7.7/gemset.wrappers.global.log
ruby-2.7.7 - #gemset created /usr/share/rvm/gems/ruby-2.7.7
ruby-2.7.7 - #importing gemsetfile /usr/share/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.7.7 - #generating default wrappers...............
Error running 'run_gem_wrappers regenerate',
please read /usr/share/rvm/log/1675767030_ruby-2.7.7/gemset.wrappers.default.log

Here is dump of log

[2023-02-07 11:51:03] run_gem_wrappers
run_gem_wrappers ()
{
    gem_install gem-wrappers > /dev/null && gem_wrappers_pristine && gem wrappers "$@" || return $?
}
current path: /home/andrzejsliwa
GEM_PATH=/usr/share/rvm/gems/ruby-2.7.7@global
GEM_HOME=/usr/share/rvm/gems/ruby-2.7.7@global
PATH=/usr/share/rvm/gems/ruby-2.7.7@global/bin:/usr/share/rvm/rubies/ruby-2.7.7/bin:/usr/share/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/Common Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/Java/jdk-17/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Gradle/gradle-7.6/bin:/mnt/c/Users/andrz/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/andrz/AppData/Local/JetBrains/Toolbox/scripts:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/andrz/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin
command(2): run_gem_wrappers regenerate
+ gem_install gem-wrappers
+ typeset gem_name gem_version version_check
+ gem_version=
+ __rvm_parse_gems_args gem-wrappers
+ typeset gem=gem-wrappers
+ __rvm_string_match gem-wrappers '*.gem$'
+ typeset _string
+ _string=gem-wrappers
+ shift
+ ((  1  ))
+ case "${_string}" in
+ shift
+ ((  0  ))
+ return 1
+ gem_name=gem-wrappers
+ case "$gem" in
+ [[ -z '' ]]
+ __rvm_db gem_gem-wrappers_version gem_version
+ typeset value key variable
+ key=gem_gem-wrappers_version
+ variable=gem_version
+ value=
+ [[ -f /usr/share/rvm/user/db ]]
++ __rvm_db_ /usr/share/rvm/user/db gem_gem-wrappers_version
++ typeset __db __key __value
++ __db=/usr/share/rvm/user/db
++ __key=gem_gem-wrappers_version
++ shift 2
++ __value=
++ case "${__value}" in
++ __rvm_db_get /usr/share/rvm/user/db gem_gem-wrappers_version
++ [[ -f /usr/share/rvm/user/db ]]
++ __rvm_sed -n -e '\#^gem_gem-wrappers_version=# { s#^gem_gem-wrappers_version=##;; p; }' -e '/^$/d'
++ sed -n -e '\#^gem_gem-wrappers_version=# { s#^gem_gem-wrappers_version=##;; p; }' -e '/^$/d'
+ value=
+ [[ -z '' ]]
+ [[ -f /usr/share/rvm/config/db ]]
++ __rvm_db_ /usr/share/rvm/config/db gem_gem-wrappers_version
++ typeset __db __key __value
++ __db=/usr/share/rvm/config/db
++ __key=gem_gem-wrappers_version
++ shift 2
++ __value=
++ case "${__value}" in
++ __rvm_db_get /usr/share/rvm/config/db gem_gem-wrappers_version
++ [[ -f /usr/share/rvm/config/db ]]
++ __rvm_sed -n -e '\#^gem_gem-wrappers_version=# { s#^gem_gem-wrappers_version=##;; p; }' -e '/^$/d'
++ sed -n -e '\#^gem_gem-wrappers_version=# { s#^gem_gem-wrappers_version=##;; p; }' -e '/^$/d'
+ value='>=1.4.0'
+ [[ -n >=1.4.0 ]]
+ [[ -n gem_version ]]
+ eval 'gem_version='\''>=1.4.0'\'''
++ gem_version='>=1.4.0'
+ true
+ ((  0 == 0  ))
+ is_gem_installed
+ typeset gem_spec
+ gem_spec='gem '\''gem-wrappers'\'''
+ [[ -n >=1.4.0 ]]
+ gem_spec+=', '\''>=1.4.0'\'''
+ version_check=1.4.0
+ __rvm_ls -ld /usr/share/rvm/gems/ruby-2.7.7@global/gems/gem-wrappers-1.4.0
+ /usr/share/rvm/rubies/ruby-2.7.7/bin/ruby -rrubygems -e 'gem '\''gem-wrappers'\'', '\''>=1.4.0'\'''
+ return 1
+ gem_install_force
+ typeset __available_gem
+ typeset -a install_params
+ install_params=()
++ __rvm_ls -v1 /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem
++ tail -n 1
+ __available_gem=/usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem
+ [[ -n /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem ]]
+ install_params+=(--local)
++ command gem --version
+ __rvm_version_compare 3.1.6 -ge 2.2
+ typeset first
++ command printf %b '3.1.6\n2.2\n'
++ __rvm_version_sort
++ command head -n1
++ command awk '-F[.-]' -v OFS=. '{                   # split on "." and "-", merge back with "."
    original=$0                                        # save original to preserve it before the line is changed
    for (n=1; n<10; n++) {                             # iterate through max 9 components of version
      $n=tolower($n)                                   # ignore case for sorting
      if ($n == "")                 $n="0"             # treat non existing parts as 0
      if ($n ~ /^p[0-9]/)           $n=substr($n, 2)   # old ruby -p notation
      if ($n ~ /^[0-9](rc|b)/)      $n=substr($n, 1, 1)". "substr($n, 2)   # old jruby 0RC1 notation
      if (n == 1 && $n ~ /^[0-9]/)  $n="zzz."$n        # first group must be a string
      if (n > 1 && $n ~ /^[a-z]/)   $n=" "$n           # names go before numbers thanks to space
    }
    print $0"\t"original                               # print the transformed version and original separated by \t
                                                       # so we can extract original after sorting
  }'
++ LC_ALL=C
++ sort -t. -k 1,1d -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
++ awk '-F\t' '{print $2}'
+ first=2.2
+ case "$2" in
+ [[ 2.2 == \h\e\a\d ]]
+ [[ 2.2 == \2\.\2 ]]
+ return 0
+ install_params+=(--no-document)
+ __rvm_log_command 'gem.install.gem-wrappers->=1.4.0' 'installing gem /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document' command gem install /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document
+ typeset name message _command_start _command_name
+ typeset -a _command
+ name='gem.install.gem-wrappers->=1.4.0'
+ message='installing gem /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document'
+ shift 2
+ _command=("$@")
+ _command_start=command
+ ((  6  ))
+ [[ command == *\=* ]]
+ _command_name=command
+ [[ command != *\=* ]]
+ __function_on_stack __rvm_log_command_internal
+ __rvm_string_includes '__function_on_stack __rvm_log_command gem_install_force gem_install run_gem_wrappers __rvm_log_dotted __rvm_log_command_internal __rvm_log_command gemset_initial __rvm_with gemset_create __rvm_initial_gemsets_create_gemsets __rvm_initial_gemsets_create_without_rubygems external_import_setup external_import main' __rvm_log_command_internal
+ typeset __search '__text=__function_on_stack __rvm_log_command gem_install_force gem_install run_gem_wrappers __rvm_log_dotted __rvm_log_command_internal __rvm_log_command gemset_initial __rvm_with gemset_create __rvm_initial_gemsets_create_gemsets __rvm_initial_gemsets_create_without_rubygems external_import_setup external_import main'
+ shift
+ for __search in "$@"
+ [[  __function_on_stack __rvm_log_command gem_install_force gem_install run_gem_wrappers __rvm_log_dotted __rvm_log_command_internal __rvm_log_command gemset_initial __rvm_with gemset_create __rvm_initial_gemsets_create_gemsets __rvm_initial_gemsets_create_without_rubygems external_import_setup external_import main  == *\ \_\_\r\v\m\_\l\o\g\_\c\o\m\m\a\n\d\_\i\n\t\e\r\n\a\l\ * ]]
+ return 0
+ __rvm_log_command_simple command gem install /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document
+ __rvm_log_command_debug
++ __rvm_date '+%Y-%m-%d %H:%M:%S'
++ date '+%Y-%m-%d %H:%M:%S'
+ printf %b '[2023-02-07 11:51:03] command\n'
+ is_a_function command
+ typeset -f command
+ return 1
+ printf %b 'current path: /home/andrzejsliwa\n'
+ env
+ __rvm_grep -E '^GEM_HOME=|^GEM_PATH=|^PATH='
+ GREP_OPTIONS=
+ command grep -E '^GEM_HOME=|^GEM_PATH=|^PATH='
+ printf %b 'command(6): command gem install /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document\n'
+ rvm_log 'installing gem /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document'
+ [[ '' == 1 ]]
+ printf %b 'installing gem /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document\n'
+ command gem install /usr/share/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document
ERROR:  Loading command: install (LoadError)
        cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
+ return 1
+ return 1
+ return 1
+ return 1
+ return 1

Expected behavior

No errors

Actual behavior

Errors with ruby 2.7.7

Environment info

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

Running under Win 11 Pro, WSL2

raelgc commented 1 year ago

@andrzejsliwa I've appreciated you taking your time to report this issue. But this repo is only for the Ubuntu installer and this is a rvm issue.

You can see a nice workaround here: https://github.com/rvm/ubuntu_rvm/issues/67#issuecomment-1107065230