Search code examples
rubymine

Method invocation may produce 'NoMethodError' in Ruby


I have some code:

# frozen_string_literal: true

require 'httpclient'

client = HTTPClient.new
response = client.get 'https://httpbin.org/get'

body = response.body

puts body

Why RubyMine have warning about Method invocation may produce 'NoMethodError'?


Solution

  • There's a corresponding issue on the RubyMine's tracker so you can follow it: https://youtrack.jetbrains.com/issue/RUBY-24592