Unable to open Shopify API console - undefined method to_yaml

Shopify Partner
21 0 9

I'm trying to get the Shopify API console to work, I'm using a Mac running Mavericks and ruby 1.9.3 under rvm, and gem shopify_api-3.2.7.  I have a working app built in Rails, but I cannot open the console.  I've added a private app to my test shop to use with the console. The recommended url to get credentials https://wooster-test.myshopify.com/admin/api returns a white screen.   I got the credentials from the shop admin and tried to open the console.  That returns the following error:

Peter:shopifyapp peter$ shopify add wooster-test
Domain? (leave blank for wooster-test.myshopify.com) 

open https://wooster-test.myshopify.com/admin/api in your browser to get API credentials
API key? xxx
Password? xxx
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/shopify_api-3.2.1/lib/shopify_api/cli.rb:32:in `add': undefined method `to_yaml' for #<Hash:0x0000010215c540> (NoMethodError)
        from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/shopify_api-3.2.1/bin/shopify:4:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/shopify:19:in `load'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/shopify:19:in `<main>'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
        from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Peter:shopifyapp peter$ 


A closed topic from last year: https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/nomethod-to_yaml-when-trying-to-create...

recommended updating the Shopify API gem, that did not help, it appears that the update to shopify_api-3.2.7 didn't take, it's a multi-user rvm setup and it appears to still using shopify_api-3.2.1.



Shopify Partner
21 0 9

I believe I have this working.  The problem was that an old version of the shopify_api gem was installed and being used even after update.  

gem cleanup shopify_api

seems to have fixed the problem.