Between 9pm - 11pm ET this Sat (9/18), we will be doing routine network maintenance. Please avoid usage of our API during this time frame - including any scheduled sync jobs. Thank you in advance for your patience.

Rails gem

VivianV9
Participant

Rails gem

Hi,

 

I've installed the Rails gem https://github.com/wishery/constant_contact and created a model, but when I go to the console and try to work with the ConstantContent model, I get the error:

 

LoadError: Expected <file path>/gems/whenever-0.3.7/lib/base.rb to define Base

 

This is my constant_contact.rb:

 

class ConstantContact < ActiveRecord::Base
  ConstantContact::Base.user = '***'
  ConstantContact::Base.api_key = '***'
  ConstantContact::Base.password = '***'
 
  # Contact not found. Create it.
  begin
    @constant_contact = ConstantContact::Contact.new(
      :email_address => "me@example.com"
    )
    @constant_contact.save
  rescue ActiveResource::ResourceConflict => e
    # contact already exists
    puts 'Contact already exists. Saving contact failed.'
    puts e
  end
end

 

Any help is appreciated!

3 REPLIES 3
Mark-C
Member

Hi,

 

The Rails gem you're using was developed by a third party, whom you should contact directly for support in resolving errors. This library is several steps revised from the original developed by Github user timcase. Because this originated from a library developed three years ago, and we do not track updates to third-party libraries, there may be some deprecated functionality or code lingering in the library.  At this time, we don't offer any Constant Contact Ruby/Rails libraries that we can directly support.

 

The error you indicate appears to indicate a problem with your Ruby or Rails setup/configuration, so you may want to seek assistance through the Rails Developer communities.

 

I hope this points you in the right direction to get things rolling.

 

Cheers,

Mark Coleman
Support Engineer

Thanks, Marc, I am trying to get an aswer through those avenues.  I just thought I'd try here as well.

I understand.  It is definitely worth a try.  Perhaps one of our third-party developers with direct expeirence using the same or a one of the earlier forks of that wrapper and similar Ruby/Rails setup error will see your request. I'll put out some feelers internally and as I have some time will also research the error myself and post back if I find something that may be useful. 

Mark Coleman
Support Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page