rvm / gem-wrappers

Create gem wrappers for easy use of gems in cron and other system locations.
Other
14 stars 4 forks source link

GemWrappers: Can not wrap not executable file: x/y/z/.../xx.lock #16

Open honood opened 2 months ago

honood commented 2 months ago

After installing Ruby 3.3.5, I got the following many warning messages like the following when updating or installing gems:

GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/ri.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/racc.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/rdoc.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/rdbg.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/rbs.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/typeprof.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/rake.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/erb.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/irb.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/ri.lock
GemWrappers: Can not wrap not executable file: /Users/Me/.rvm/gems/ruby-3.3.5/bin/racc.lock

The installed gem-wrapper is 1.4.0.

RemcodM commented 1 month ago

I presume the .lock files do not need any gem wrapper. I found the output so much distracting that I temporarily commented out the warning message:

sed -i "s/warn \"GemWrappers: Can not wrap not executable file: #{target_path}\"/# warn \"GemWrappers: Can not wrap not executable file: #{target_path}\"/g" ~/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/gem-wrappers-1.4.0/lib/gem-wrappers/installer.rb

Obviously, a more proper fix would be to ignore the lock files somehow.

bvogel commented 1 month ago

I went a even more drastic way, as I don't need wrappers, and I surely hadn't installed the wrapper gem manually so it must have been installed by rvm, I just ended uninstalling it:

gem uninstall -i ~/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0 gem-wrappers
roberts1000 commented 1 month ago

RubyGems 3.5.19 and Bundler 2.5.19 remove the .lock files that trigger the warnings from GemWrappers.

martinbarilik commented 1 month ago

RubyGems 3.5.19 and Bundler 2.5.19 remove the .lock files that trigger the warnings from GemWrappers.

didn't fix the problem for me ...

$debian: bundler -v
Bundler version 2.5.19
$debian: gem -v
3.5.19
$debian: gem install ruby-lsp -v 0.18
Fetching ruby-lsp-0.18.0.gem
GemWrappers: Can not wrap not executable file: /home/.../bin/irb.lock
GemWrappers: Can not wrap not executable file: /home/.../bin/rdoc.lock
GemWrappers: Can not wrap not executable file: /home.../bin/ri.lock
Successfully installed ruby-lsp-0.18.0
Parsing documentation for ruby-lsp-0.18.0
Installing ri documentation for ruby-lsp-0.18.0
Done installing documentation for ruby-lsp after 0 seconds
1 gem installed
roberts1000 commented 1 month ago

@martinbarilik I'd let RubyGems know there's still an issue. After a very quick read through of the code, I don't think this is a problem with GemWrappers - it's just warning that it's seeing unexpected files.

If anyone else is having this issue, the fix seems to be to get the .lock files removed. If you're still having trouble, a workaround is to manually remove the .lock files, in the directory that is reported in the warning.

ekortright-ewtn commented 1 month ago

@martinbarilik I'd let RubyGems know there's still an issue. After a very quick read through of the code, I don't think this is a problem with GemWrappers - it's just warning that it's seeing unexpected files.

If anyone else is having this issue, the fix seems to be to get the .lock files removed. If you're still having trouble, a workaround is to manually remove the .lock files, in the directory that is reported in the warning.

Removing the .lock files eliminated the warnings for me. Thanks.