ruby/rubygems · error · Bundler::PermissionError

23

23

Error message

There was an error while trying to #{action} `#{@path}`. It is likely that you need to grant #{permission_type}.

What it means

Error "There was an error while trying to #{action} `#{@path}`. It is likely that you need to grant #{permission_type}." thrown in ruby/rubygems.

Source

Thrown at lib/bundler/shared_helpers.rb:111

    #
    # @raise [Bundler::PermissionError] if Errno:EACCES is raised in the
    #   given block
    # @raise [Bundler::TemporaryResourceError] if Errno:EAGAIN is raised in the
    #   given block
    #
    # @example
    #   filesystem_access("vendor/cache", :create) do
    #     FileUtils.mkdir_p("vendor/cache")
    #   end
    #
    # @see {Bundler::PermissionError}
    def filesystem_access(path, action = :write, &block)
      yield(path.dup)
    rescue Errno::EACCES => e
      path_basename = File.basename(path.to_s)
      raise unless e.message.include?(path_basename) || action == :create

      raise PermissionError.new(path, action)
    rescue Errno::EAGAIN
      raise TemporaryResourceError.new(path, action)
    rescue Errno::EPROTO
      raise VirtualProtocolError.new
    rescue Errno::ENOSPC
      raise NoSpaceOnDeviceError.new(path, action)
    rescue Errno::ENOTSUP
      raise OperationNotSupportedError.new(path, action)
    rescue Errno::EPERM
      raise OperationNotPermittedError.new(path, action)
    rescue Errno::EROFS
      raise ReadOnlyFileSystemError.new(path, action)
    rescue Errno::EEXIST, Errno::ENOENT
      raise
    rescue SystemCallError => e
      raise GenericSystemCallError.new(e, "There was an error #{[:create, :write].include?(action) ? "creating" : "accessing"} `#{path}`.")
    end

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/shared_helpers.rb:111 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/2ad8ffb8043f5e12. Report an issue: GitHub.