5

I feel like this should be a simple problem, but I'm pulling my hair out trying to track it down. I'm installed the chargify_api_ares gem, but can't do even basic things such as

Chargify::Subscription.create

As I get this path error. I feel like this must be a gem issue somehow but don't know where to go from here.

UPDATE: bundle show chargify_api_ares shows the correct path, I just somehow can't access it. Still trying random environment related things.

Looks like this is the source of the problem, in active_resource\base.rb:

# Gets the \prefix for a resource's nested URL (e.g., <tt>prefix/collectionname/1.json</tt>)
      # This method is regenerated at runtime based on what the \prefix is set to.
      def prefix(options={})
        default = site.path
        default << '/' unless default[-1..-1] == '/'
        # generate the actual method based on the current site path
        self.prefix = default
        prefix(options)
      end

As I understand it, Chargify.subdomain should be setting the site.path, but I don't understand activeresource well enough yet to know what's happening and will continue to dig.

RubyNoob
  • 243
  • 1
  • 2
  • 8
  • UPDATE: I'm tried this via the rails console, with the same results for whatever that's worth. – RubyNoob May 11 '12 at 03:59
  • UPDATE2: To clarify: I AM adding valid args to create(), and am also setting Chargify.subdomain and Chargify.api_key prior to the create call - though the issue seems to be before any Chargify specific logic anyhow. – RubyNoob May 11 '12 at 22:50

1 Answers1

0

I too had the same issue. I executed the following on the console

Chargify.configure do |c|
  c.api_key   = "<<api_key>>"
  c.subdomain = "<<subdomain>>"
end

After that performing any Chargify console commands went through fine.