Ruby `打开http';:500内部服务器错误(OpenURI::HTTPError)

Ruby `打开http';:500内部服务器错误(OpenURI::HTTPError),ruby,json,http,parsing,Ruby,Json,Http,Parsing,我正在尝试解析一个url,但仍然有这个500。有什么建议吗 require 'open-uri' require 'json' require 'csv' url = 'https://gist.githubusercontent.com/gregclermont/ca9e8abdff5dee9ba9db/raw/ 7b2318efcf8a7048f720bcaff2031d5467a4a2c8/users.json' encoded_url = URI.encode(url) open(e

我正在尝试解析一个url,但仍然有这个500。有什么建议吗

require 'open-uri'
require 'json'
require 'csv'

url = 'https://gist.githubusercontent.com/gregclermont/ca9e8abdff5dee9ba9db/raw/
7b2318efcf8a7048f720bcaff2031d5467a4a2c8/users.json'
encoded_url = URI.encode(url)

open(encoded_url) do |stream|
  quote = JSON.parse(stream.read)
  puts quote
end
对我来说很好

require 'open-uri'
require 'json'

url = 'https://gist.githubusercontent.com/gregclermont/ca9e8abdff5dee9ba9db/raw/7b2318efcf8a7048f720bcaff2031d5467a4a2c8/users.json'

open(url) { |f| JSON.parse(f.read) }