pry/pry · error · InvalidArgumentError
#{value} could not be coerced into Float
Error message
#{value} could not be coerced into Float What it means
Error "#{value} could not be coerced into Float" thrown in pry/pry.
Source
Thrown at lib/pry/slop/option.rb:178
rescue ArgumentError
raise InvalidArgumentError, "#{value} could not be coerced into Integer"
end
else
value.to_s.to_i
end
end
# Convert an object to a Float if possible.
#
# value - The Object we want to convert to a float.
#
# Returns the Float value if possible to convert, else a zero.
def value_to_float(value)
if @slop.strict?
begin
Float(value.to_s)
rescue ArgumentError
raise InvalidArgumentError, "#{value} could not be coerced into Float"
end
else
value.to_s.to_f
end
end
# Convert an object to a Range if possible.
#
# value - The Object we want to convert to a range.
#
# Returns the Range value if one could be found, else the original object.
def value_to_range(value)
case value.to_s
when /\A(\-?\d+)\z/
Range.new(Regexp.last_match(1).to_i, Regexp.last_match(1).to_i)
when /\A(-?\d+?)(\.\.\.?|-|,)(-?\d+)\z/
Range.new(
Regexp.last_match(1).to_i,View on GitHub (pinned to 1356402628)
When it happens
Trigger: Thrown at lib/pry/slop/option.rb:178 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/d487d1efd080801c.
Report an issue: GitHub.