Question

ruby doproxy.rb create Error

Hi Friends,

I am able to create new droplets with below commands

**ruby doproxy.rb create **

But when I try to “ruby doproxy.rb print” i got below error.

root@doproxy:~/doproxy# ruby doproxy.rb print /root/.rbenv/versions/2.2.3/lib/ruby/2.2.0/uri/generic.rb:1100:in rescue in merge': bad URI(is not URI?): /v2/droplets/12042416 (URI::InvalidURIError) from /root/.rbenv/versions/2.2.3/lib/ruby/2.2.0/uri/generic.rb:1097:in merge’ from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:406:in build_exclusive_url' from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:192:in build_env’ from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in build_response' from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in run_request’ from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:140:in get' from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/resource_kit-0.1.4/lib/resource_kit/action_invoker.rb:34:in response’ from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/resource_kit-0.1.4/lib/resource_kit/action_invoker.rb:18:in handle_response' from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/resource_kit-0.1.4/lib/resource_kit/action_invoker.rb:14:in call’ from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/resource_kit-0.1.4/lib/resource_kit/method_factory.rb:16:in block in method_for_action' from doproxy.rb:39:in block in get_inventory’ from doproxy.rb:38:in each_line' from doproxy.rb:38:in get_inventory’ from doproxy.rb:29:in initialize' from doproxy.rb:140:in new’ from doproxy.rb:140:in `<main>’

Now am also not able to create new droplets with **ruby doproxy.rb create **

Getting same error as above “ruby doproxy.rb print”

Please help with the solution.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi Erls,

Thanks for your response.

Now I am getting below error

root@doproxy:~/doproxy# ruby doproxy.rb create doproxy.rb:41:in block in get_inventory': undefined method id’ for #String:0x007f0944de3c90 (NoMethodError) from doproxy.rb:38:in each_line' from doproxy.rb:38:in get_inventory’ from doproxy.rb:29:in initialize' from doproxy.rb:140:in new’ from doproxy.rb:140:in `<main>’

oot@doproxy:~/doproxy# ruby doproxy.rb print doproxy.rb:41:in block in get_inventory': undefined method id’ for #String:0x007fd00f8109c0 (NoMethodError) from doproxy.rb:38:in each_line' from doproxy.rb:38:in get_inventory’ from doproxy.rb:29:in initialize' from doproxy.rb:140:in new’ from doproxy.rb:140:in `<main>’

Hello!

My colleague, Jason, was able to figure this error out. It looks like you’re using Ruby 2.2.3, while DOProxy needs version 2.1.5. You should be able to fix this by reinstalling droplet_kit using Ruby 2.1.5. Since droplet_kit currently needs 2.2.2+, you’ll need to use an older version of droplet_kit.

So, with that in mind, try running the following:

rbenv global 2.1.5
gem uninstall droplet_kit
gem install droplet_kit -v 1.1.3

Then, see if doproxy.rb works! :)

Thanks, Eris Platform Support Specialist