hipchat / hipchat-rb

HipChat HTTP API Wrapper in Ruby with Capistrano hooks

Home Page:https://www.hipchat.com/docs/apiv2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined method `to_json' for Hash

asymmetric opened this issue · comments

Hi, I'm trying to integrate HipChat into my Capistrano deployment.

I've followed the instructions on the README, but I get this error:

undefined method `to_json' for #<Hash:0x0000000169b648>

Googling, I found PR #61, which led me to adding a require "json" just before require hipchat/capistrano.

This fixed the issue.

What also fixed the issue was a require "active_support/core_ext".

Tried on Rails 3.2.18 on ruby 1.9.3-p125 and -p551.

Any idea what's going on? Is the information in the README incorrect?

I ran into the same issue, and your workaround worked for me. I'm using this in a Sinatra project.

I'm guessing that the gem authors assumed the #to_json method is always present in the environment.