0

i'm getting the following error when using bundler to install a the current rspec version.

The gem rspec-core-3.7.1 can't be installed because the security policy 
didn't allow it, with the message: missing digest for metadata.gz

So i tried to run

bundle --trust-policy=NoSecurity

but still getting the same error.

What am i doing wrong?

Christoph
  • 26
  • 3

2 Answers2

1

from https://github.com/bundler/bundler/blob/master/lib/bundler/rubygems_integration.rb

# TODO: This is for older versions of RubyGems... should we support the
# X-Gemfile-Source header on these old versions?
# Maybe the newer implementation will work on older RubyGems?
# It seems difficult to keep this implementation and still send the header.

I would try the following

  1. Update Rubygem

    gem install rubygems-update
    update_rubygems
    gem update --system
    
  2. Change the ruby version you are using. If you are using rbenv follow this guide otherwise for rvm you have to dig in their website

  3. Update/reinstall bundler

Fabrizio Bertoglio
  • 5,890
  • 4
  • 16
  • 57
0

I got this error in WSL environment with Ubuntu 20.04.

I use rbenv & ruby-build.

I solved it this way:

Open rbenv/versions/3.1.4/lib/ruby/site_ruby/3.1.0/rubygems/security/policy.rb (ensure to replace Ruby version here to your current version).

Add this line:

return true # WARN: Workaround for a BUG!

Before this line:

signatures.each do |file, _|

Yes, it isn't a clear solution, but it works.

Previous answer didn't help me at all.

Perhaps, this problem relates to broken SSH connectivity in WSL. For example, when I type ssh <any-domain> in WSL console, I don't get any output.