Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create RVM wrappers since RubyGems 3.2.18 #475

Closed
roberts1000 opened this issue Jul 22, 2021 · 6 comments
Closed

Can't create RVM wrappers since RubyGems 3.2.18 #475

roberts1000 opened this issue Jul 22, 2021 · 6 comments

Comments

@roberts1000
Copy link

The README recommends executing the following for RVM.

rvm default@mailcatcher --create do gem install mailcatcher
ln -s "$(rvm default@mailcatcher do rvm wrapper show mailcatcher)" "$rvm_bin_path/"

The above code works great with RubyGems 3.2.17. 3.2.18 introduced a change that causes the ln -s ... line to raise the following error:

Error running 'command gem install /home/dev/.rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document',
please read /home/dev/.rvm/log/1626987562/gem.install.gem-wrappers->=1.4.0.log

The .log file contains:

command(6): command gem install /home/dev/.rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document
+ gem install /home/dev/.rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document
ERROR:  Error installing /home/dev/.rvm/gem-cache/gem-wrappers-1.4.0.gem:
	ERROR: Failed to build gem native extension.
	
No such file or directory @ dir_s_mkdir - /home/dev/.rvm/gems/ruby-2.7.4@mailcatcher/gems/gem-wrappers-1.4.0/ext/wrapper_generator/.gem.20210722-89366-nf8wb0
	

The error seems to occur with all versions of RubyGems from 3.2.18 to at least 3.2.24 (which is currently the latest version). I'm using the following to test:

Ubuntu 20.04 and 18.04
RVM 1.29.12
Ruby 2.7.4

Does mailcather need to update to match RubyGems, or is this a regression in RubyGems?

@sj26
Copy link
Owner

sj26 commented Jul 22, 2021

Sorry, I don't use RVM any more. But it sounds like a bug in RVM?

@sj26
Copy link
Owner

sj26 commented Jul 22, 2021

This still seems to be working for me, too:

docker run --rm -it ubuntu:20.04

apt update && apt install -yy gpg curl

gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

curl -sSL https://get.rvm.io | bash -s -- --version 1.29.12

source /usr/local/rvm/scripts/rvm

rvm install 2.7.4

rvm default@mailcatcher --create do gem install mailcatcher

ln -s "$(rvm default@mailcatcher do rvm wrapper show mailcatcher)" "$rvm_bin_path/"

mailcatcher --version

Results in a whole lot of output, and then:

MailCatcher v0.8.0

@roberts1000
Copy link
Author

roberts1000 commented Jul 22, 2021

That's a nice quick way to test! I followed the same steps as you and got the same result.

The missing step is to ensure RubyGems is at the correct version. Ruby 2.7.4 installs RubyGems 3.1.6 by default (which works fine). RubyGems needs to be updated to 3.2.18 to trigger the error. Here's a slight adjustment to your steps:

.... # execute all the previous steps
rvm install 2.7.4
gem update --system 3.2.18  # new
rvm default@mailcatcher --create do gem install mailcatcher --no-document # --no-document speeds-up this step
ln -s "$(rvm default@mailcatcher do rvm wrapper show mailcatcher)" "$rvm_bin_path/"
# error

That should trigger the error. After that, you can switch to 3.2.17 and try again without having to start at the top:

rvm gemset delete mailcatcher
gem update --system 3.2.17
rvm default@mailcatcher --create do gem install mailcatcher --no-document
ln -s "$(rvm default@mailcatcher do rvm wrapper show mailcatcher)" "$rvm_bin_path/"
mailcatcher --version # => MailCatcher v0.8.0

@sj26
Copy link
Owner

sj26 commented Jul 22, 2021

Ah yep, I can replicate with those commands.

But it does look like a bug within rvm, or gem-wrappers. Isolated:

root@e83e6a459997:/# gem install /usr/local/rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-document
ERROR:  Error installing /usr/local/rvm/gem-cache/gem-wrappers-1.4.0.gem:
	ERROR: Failed to build gem native extension.

    No such file or directory @ dir_s_mkdir - /usr/local/rvm/gems/ruby-2.7.4/gems/gem-wrappers-1.4.0/ext/wrapper_generator/.gem.20210722-8397-12rg6tt

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.7.4/gems/gem-wrappers-1.4.0 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.7.4/extensions/aarch64-linux/2.7.0/gem-wrappers-1.4.0/gem_make.out

root@e83e6a459997:/# cat /usr/local/rvm/gems/ruby-2.7.4/extensions/aarch64-linux/2.7.0/gem-wrappers-1.4.0/gem_make.out
No such file or directory @ dir_s_mkdir - /usr/local/rvm/gems/ruby-2.7.4/gems/gem-wrappers-1.4.0/ext/wrapper_generator/.gem.20210722-8397-12rg6tt

It remains in the latest version of rubygems, 3.2.24, as well.

@sj26
Copy link
Owner

sj26 commented Jul 22, 2021

Reported to rvm/gem-wrappers#15, please track there for a fix

@sj26 sj26 closed this as completed Jul 22, 2021
@roberts1000
Copy link
Author

Thanks for taking a look so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants