ruby gem을 사용하여 json 라이브러리를 설치할 수 있습니다. 경우에 그것은 내가 그것을 작동하지 않는 require 'json'
를 시도, 그러나 최신 OS X를ruby gem을 OS X에 설치 한 후 사용하는 방법
usr$ sudo gem install json
Password:
Building native extensions. This could take a while...
Successfully installed json-1.6.5
1 gem installed
Installing ri documentation for json-1.6.5...
Installing RDoc documentation for json-1.6.5...
을 사용하고, 관련입니다. 내가 도대체 뭘 잘못하고있는 겁니까?
#!/usr/bin/env ruby
require 'json'
x = { "a"=>"b" }
print x.to_json
당신이에게 기회를 줄 수'루비 -rubygems x.rb' – Candide
JSON은 루비 1.9.x의 STD-LIB HTTP의 일부입니다 : // WWW. ruby-doc.org/stdlib-1.9.3/libdoc/json/rdoc/JSON/Ext/Generator/GeneratorMethods/Hash.html –