0

I get this error: /LiveToChallenge/config/initializers/gibbon.rb:1:in '<top (required)>': uninitialized constant Gibbon::Request (NameError) when I try to start the server rails server.

app/config/initializers/gibbon.rb

require 'gibbon'
Gibbon::Request.api_key = "24e4a2233cd34debb76ed083dc3f8b5379-us8"
Gibbon::Request.timeout = 15

I followed gibbon gem instructions, which seemed simple enough. Maybe I'm missing something besides just gem install gibbon and adding api_key to initializer?

The gem is installed as gibbon (2.2.2, 2.2.1, 1.2.1)

And as added measure I put gem gibbon in the gemfile and ran bundle install

This problem is part of a larger problem I've been working on solving.

Community
  • 1
  • 1
AnthonyGalli.com
  • 2,796
  • 5
  • 31
  • 80

2 Answers2

1

I experienced same issue with gibbon 2.0 version as it has updated some methods for initializations then i tried a previous version & it worked but first You should try it this way :

gibbon = Gibbon::Request.new(api_key: "MailChimp_API_Key")
gibbon.timeout = 10

If no luck with this in app/config/initializers/gibbon.rb then you can try to do this direct in the controller just before using gibbon to retrieve or add list stuff for testing.

Muhammad Ali
  • 2,173
  • 15
  • 20
0

You should add the gem to the rails Gemfile. Then rails will take care of the require 'gibbon' for you.

Edit: gem install gibbon will just install the gem on your system. Rails won't know that it is needed unless you add it to the Gemfile.

sammygadd
  • 299
  • 2
  • 6