ranjeet
By:
ranjeet

ruby doproxy.rb create Error

March 16, 2016 681 views
Ruby Scaling

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
buildenv'
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
runrequest'
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/resourcekit/actioninvoker.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
handleresponse'
from /root/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/resource
kit-0.1.4/lib/resourcekit/actioninvoker.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 methodforaction'
from doproxy.rb:39:in block in get_inventory'
from doproxy.rb:38:in
eachline'
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.

2 Answers

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 dropletkit using Ruby 2.1.5. Since dropletkit 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

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 methodid' 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 `
'

oot@doproxy:~/doproxy# ruby doproxy.rb print
doproxy.rb:41:in block in get_inventory': undefined methodid' 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>'

Have another answer? Share your knowledge.