2012-05-11 40 views
5

我觉得这应该是一个简单的问题,但我拉我的头发试图追踪它。我安装了chargify_api_ares宝石,但不能做甚至基本的东西,如未定义的方法路径为零:NilClass使用chargify_api_ares宝石

Chargify::Subscription.create 

当我得到这个路径错误。我觉得这肯定是一个宝石问题,但不知道该从哪里出发。

更新:捆绑显示chargify_api_ares显示正确的路径,我只是以某种方式无法访问它。仍尝试随机环境相关的东西。

看起来这是问题的根源,在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 

据我了解,Chargify.subdomain应设置site.path,但我不明白主动资源已经足够,但不知道发生了什么,并将继续挖掘。

+0

更新:我试过这个通过轨道控制台,与任何值得相同的结果。 – RubyNoob

+0

UPDATE2:澄清:我在创建调用之前添加了有效的参数create(),并且还设置了Chargify.subdomain和Chargify.api_key - 尽管问题似乎在任何Chargify特定逻辑之前。 – RubyNoob

回答

0

我也有同样的问题。 在控制台上执行我下面

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

之后执行任何Chargify控制台命令通过罚款去了。

相关问题