pry/pry · error · Pry::CommandError

Minimum value for range is 1, not 0.

Error message

Minimum value for range is 1, not 0.

What it means

Error "Minimum value for range is 1, not 0." thrown in pry/pry.

Source

Thrown at lib/pry/commands/code_collector.rb:143

      end

      # Name of the object argument
      def obj_name
        @obj_name ||= args.empty? ? "" : args.join(" ")
      end

      private

      def bad_option_combination?
        [opts.present?(:in), opts.present?(:out),
         !args.empty?].count(true) > 1
      end

      def pry_array_content_as_string(array, ranges)
        all = ''
        ranges.each do |range|
          if convert_to_range(range).first == 0
            raise CommandError, "Minimum value for range is 1, not 0."
          end

          ranged_array = Array(array[range]) || []
          ranged_array.compact.each { |v| all += yield(v) }
        end

        all
      end

      def code_object_doc
        (code_object && code_object.doc) || could_not_locate(obj_name)
      end

      def code_object_source_or_file
        (code_object && code_object.source) || file_content
      end

      def file_content

View on GitHub (pinned to 1356402628)

When it happens

Trigger: Thrown at lib/pry/commands/code_collector.rb:143 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pry/pry@1356402628 (2026-08-21). Data as JSON: /api/errors/74ca8d81080db096. Report an issue: GitHub.