-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Site URI #1
Comments
Can you post the stack trace please. On Thu, Jun 16, 2011 at 1:24 PM, bgetting <
Chris Scott |
Sure. I've been just testing it out in the console, but here is the stack trace that is output: from /Users/briangetting/.rvm/gems/ruby-1.9.2-p0/gems/activeresource-3.0.7/lib/active_resource/connection.rb:32:in |
Please show me some simple test-code that produces your error. On Thu, Jun 16, 2011 at 1:59 PM, bgetting <
Chris Scott |
No problem. Here is what I am doing. As I mentioned, I am just testing to see how it works before getting into writing actual code: s = Store.find(:first) # returns a store object |
Interesting.
On Thu, Jun 16, 2011 at 2:05 PM, bgetting <
Chris Scott |
That's great news.I'll give it a try. The actual app will be built using Rails 3.1, which I believe does not include any changes to ActiveResource. Thanks for your help with this, I appreciate it. |
Perhaps your could summarize this thread, including your test-code and https://github.com/christocracy/shopify-api-limits/issuesThen others with On Thu, Jun 16, 2011 at 2:27 PM, bgetting <
Chris Scott |
Oops. Just updated the bundle to use Rails 3.0.8, and I'm seeing the same thing. By setting the ShopifyAPI::Base.site it gives me the "missing site URI" error. By setting the ActiveResource::Base.site I get a NoMethodError: NoMethodError: You have a nil object when you didn't expect it! I'm worried that I am doing something stupid... |
try this in console and post the result
On Thu, Jun 16, 2011 at 2:33 PM, bgetting <
Chris Scott |
Thanks a ton for your help with this. The gem is a great idea, and much needed by people like me. It seems strange, as if I set the ActiveResource::Base.site directly, it works. However, any attempt to set ShopifyAPI::Base.site makes it fail. It would be ideal if we could just set ShopifyAPI::Base.site, since our app sets that for each store that it needs to interact with and then sets it back to nil when it is finished. Here is the console session where it works: ruby-1.9.2-p0 > s = Store.first Here is the console session that I was just playing with where it fails: ruby-1.9.2-p0 > s = Store.first ruby-1.9.2-p0 > ActiveResource::Base.site => #<URI::HTTPS:0x000001031a48f8 URL:https://aa17b7d22ad86e3f3019213792c693cd:34a14d34xxxxa3843bd42f41593@raynor-heathcote5504.myshopify.com/admin> ruby-1.9.2-p0 > ShopifyAPI::Base.site => #<URI::HTTPS:0x000001031c0b70 URL:https://aa17b7d22ad86e3f3019213792c693cd:34a14d34xxxxa3843bd42f41593@raynor-heathcote5504.myshopify.com/admin/> It's test store, in case that makes a difference. Hopefully this helps, and I'm really hoping that I am just doing something wrong... |
Best I can tell, it works fine when you set ActiveResource::Base.site, but not when you set ShopifyAPI::Base.site. |
I have this issue as well - bgetting your last comment indicates that you've got it working? How so?
Thanks for any help! |
You can see which version of AR you are using by running 'gem list'. I got it working by just setting ActiveResource::Base.site instead of ShopifyAPI::Base.site. |
3.0.7 it is. It worked - I just had to exit and re-open the console, and do only AR::Base.site |
Strike that - new error:
|
I get this "Missing site URI" error in Rails 3.1.0rc6. I ran through the shopify instructions to create an app. The generated controller includes: @products = ShopifyAPI::Product.find(:all, :params => {:limit => 3}) Which works fine, but adding shopify_api and shopify-api-limits gems to Gemfile and changing 3 to Tried the code you suggest running at console, got:
|
I see you're using ruby 1.8. The gem does a hack to ActiveResource::Base Sorry, I didn't test it in 1.8 -- I made it for a case of beer offered by On Wed, Aug 17, 2011 at 3:34 PM, pushcx <
Chris Scott |
No, my ruby --version says: |
Using the following gem combination:
shopify_app 1.0.1
shopify_api 1.2.5
shopify-api-limits
I can run all API calls successfully by setting the ShopifyAPI::Base.site for my store, but when I try and run any of the methods from the API limits gem (such as ShopifyAPI.credit_left) I get the following error:
ArgumentError: Missing site URI
Is this a compatibility issue or am I doing something wrong? Thanks for any help that you can provide, I appreciate it.
The text was updated successfully, but these errors were encountered: