Why does gibbon throw 'uninitialized constant Gibbon::API (NameError)'

↘锁芯ラ 提交于 2019-12-10 13:58:58

问题


I'm trying to add the gibbon gem into a Rails 3.2 app.

I've followed the instructions, and set up a gibbon.rb initializer with the following

Gibbon::API.api_key = ENV["MAILCHIMP_API_KEY"]
Gibbon::API.timeout = 15
Gibbon::API.throws_exceptions = false

The app is throwing

uninitialized constant Gibbon::API (NameError)

I've tried to require 'gibbon' amongst other things, but nothing seems to work.

Why is the class not initialized?


回答1:


Turns out I was using the wrong version of the gem.

Github sports a shiney new version 0.5, while rubygems is still on v. 0.4.

Installing from git: 'git://github.com/amro/gibbon.git' solved everything!

facepalm!




回答2:


I'm Gibbon's maintainer. Sorry for the trouble. I've updated the readme (Thanks Charles) to reflect the fact that 0.4.x is the current release and linked to its readme (most recent pre 0.5.x commit). In the future I'll be sure to create a new branch so as not to confuse people.

Version 0.5.0 is still in testing but should be released very soon. The docs are different because it hits a new version of MailChimp's API, which is substantially different from the old API.



来源:https://stackoverflow.com/questions/17228587/why-does-gibbon-throw-uninitialized-constant-gibbonapi-nameerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!