I'm trying to use httparty

require 'httparty'

but I'm getting

no such file to load -- httparty (LoadError)

I'm using Ruby 1.8.7 on OSX

有帮助吗?

解决方案

On Ruby 1.8, you have to do require "rubygems" before you can require any Gems in your code. So:

require "rubygems"
require "httparty"

# Your code here.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top