RubyonRailsコンソールでは「net/http」は機能しますが、コントローラーでは機能せず、タイムアウトエラーが発生します。
require 'net/http'
uri = URI('http://localhost:3000/api_json.json')
json = Net::HTTP.get(uri)
parsed_json = ActiveSupport::JSON.decode(json)
RubyonRailsコンソールでは「net/http」は機能しますが、コントローラーでは機能せず、タイムアウトエラーが発生します。
require 'net/http'
uri = URI('http://localhost:3000/api_json.json')
json = Net::HTTP.get(uri)
parsed_json = ActiveSupport::JSON.decode(json)