{"record":{"id":"104d4060eca5745a","repo":"ruby/rubygems","slug":"unsigned-gems-are-not-allowed-by-the-name-polic","errorCode":null,"errorMessage":"unsigned gems are not allowed by the #{name} policy","messagePattern":"unsigned gems are not allowed by the #(.+?) policy","errorType":"exception","errorClass":"Gem::Security::Exception","httpStatus":null,"severity":"error","filePath":"lib/rubygems/security/policy.rb","lineNumber":209,"sourceCode":"    certificate.subject.to_s\n  end\n\n  def inspect # :nodoc:\n    format(\"[Policy: %s - data: %p signer: %p chain: %p root: %p \" \\\n     \"signed-only: %p trusted-only: %p]\", @name, @verify_chain, @verify_data, @verify_root, @verify_signer, @only_signed, @only_trusted)\n  end\n\n  ##\n  # For +full_name+, verifies the certificate +chain+ is valid, the +digests+\n  # match the signatures +signatures+ created by the signer depending on the\n  # +policy+ settings.\n  #\n  # If +key+ is given it is used to validate the signing certificate.\n\n  def verify(chain, key = nil, digests = {}, signatures = {}, full_name = \"(unknown)\")\n    if signatures.empty?\n      if @only_signed\n        raise Gem::Security::Exception,\n          \"unsigned gems are not allowed by the #{name} policy\"\n      elsif digests.empty?\n        # lack of signatures is irrelevant if there is nothing to check\n        # against\n      else\n        alert_warning \"#{full_name} is not signed\"\n        return\n      end\n    end\n\n    opt       = @opt\n    digester  = Gem::Security.create_digest\n    trust_dir = opt[:trust_dir]\n    time      = Time.now\n\n    _, signer_digests = digests.find do |_algorithm, file_digests|\n      file_digests.values.first.name == Gem::Security::DIGEST_NAME\n    end","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/security/policy.rb#L191-L227","documentation":"Error \"unsigned gems are not allowed by the #{name} policy\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/security/policy.rb:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Sign the gem (gem cert / gem sign) so it satisfies the security policy","Or install with a lower policy such as `--trust-policy LowSecurity`"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}