HTTParty gives me 'Connection refused - connect(2) for "127.0.0.1" port 8881' in >= Ruby 2.0.0 -


this weird error. i'm in process of upgrading rails 3.2.21 app ruby 2. works fine, when want make http requests using httparty within rails, following error:

errno::econnrefused: connection refused - connect(2) "127.0.0.1" port 8881     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/net/http.rb:879:in `initialize'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/net/http.rb:879:in `open'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/timeout.rb:67:in `timeout'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/net/http.rb:878:in `connect'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/net/http.rb:863:in `do_start'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/net/http.rb:852:in `start'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/net/http.rb:1369:in `request'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/httparty-0.13.5/lib/httparty/request.rb:101:in `perform'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/httparty-0.13.5/lib/httparty.rb:522:in `perform_request'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/httparty-0.13.5/lib/httparty.rb:460:in `get'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/httparty-0.13.5/lib/httparty.rb:560:in `get'     (irb):1     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.21/lib/rails/commands/console.rb:47:in `start'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.21/lib/rails/commands/console.rb:8:in `start'     /users/stuart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.21/lib/rails/commands.rb:41:in `<top (required)>'     script/rails:6:in `require'     script/rails:6:in `<main>' 

if try , connect same url using other method (web browser, curl, net::http), can url fine. if run irb , require httparty , make same request, works.

here's gemfile:

source 'https://rubygems.org'  gem 'rails', '~> 3.2.21'  # bundle edge rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git'  # gem "mongoid", "~> 3.0.0" # gem 'bson_ext'  # gems used assets , not required # in production environments default. group :assets   gem 'sass'   gem 'sass-rails',   '~> 3.2.3'   gem 'coffee-rails', '~> 3.2.1'    gem 'haml', '>= 3.1.3'    # see https://github.com/sstephenson/execjs#readme more supported runtimes   gem 'therubyracer', :platforms => :ruby   gem 'less-rails'   gem 'less-rails-bootstrap', '~> 2.3.3'   gem 'twitter-bootstrap-rails-confirm'    gem 'uglifier', '>= 1.0.3' end  group :test   gem "factory_girl_rails", "~> 4.0"   gem 'sqlite3'   gem 'coveralls'   gem 'shoulda'   gem 'mocha', require: false   gem 'test-unit'   gem 'pry'   gem 'csvlint', github: 'theodi/csvlint.rb'   gem 'vcr'   gem 'webmock'   gem 'shoulda-context'   gem 'timecop'   gem 'cucumber-rails', require: false   gem 'database_cleaner' end  group :development   gem 'guard', '~> 1.8.3'   gem 'guard-test'   # gem 'spring', github: 'jonleighton/spring'   gem 'terminal-notifier-guard'   gem 'ruby-prof'   gem 'rails-footnotes', '>= 3.7.9'   gem 'rubyxl' end  group :production   gem 'foreman'   gem 'mysql2'   gem 'airbrake'   gem 'delayed-plugins-airbrake'   gem 'logstash-event'   gem 'lograge' end  group :surveyor   gem 'fastercsv', '~> 1.5.4'   gem 'formtastic', '~> 2.1.0'   gem 'uuidtools', '~> 2.1'   gem 'mustache', '0.99.4'   gem 'rabl', '~>0.6.13' end  gem 'jquery-rails'  #to serve static content / styleguide gem 'high_voltage'  # states of questionnaires gem 'aasm'  # authorization gem 'cancan'  # pagination gem 'kaminari'  # use activemodel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0'  # use jbuilder templates json # gem 'jbuilder'  # use unicorn app server # gem 'unicorn' gem 'thin'  # deploy capistrano # gem 'capistrano'  # use debugger # gem 'debugger'  gem "ransack" gem 'surveyor', path: 'vendor/gems/surveyor-1.4.0' gem 'redcarpet' gem "devise", "3.0.3" gem 'dotenv-rails' gem 'httparty' gem 'data_kitten', github: 'theodi/data_kitten' gem 'delayed_job_active_record' gem 'linkeddata' gem 'rack-linkeddata' gem 'jbuilder' gem 'rack-cors', require: 'rack/cors' gem 'alternate_rails', :github => 'theodi/alternate-rails' gem 'fog' gem 'juvia_rails', github: 'theodi/juvia_rails' gem 'domainatrix' # newrelic appears adding significant performance problems #gem 'newrelic_rpm' gem 'google_drive' gem 'pry-remote' gem 'memoist' gem 'validate_url' gem 'sidekiq' gem 'sinatra', :require => nil 

and gemfile.lock

git   remote: git://github.com/theodi/alternate-rails.git   revision: 188889d66c5df1d7d13f7c6e53e8088e3503dea1   specs:     alternate_rails (0.0.1)       rails (~> 3.2.13)  git   remote: git://github.com/theodi/csvlint.rb.git   revision: 3dc689f4625c8edd4f7b725d1d420fdd67a67df9   specs:     csvlint (0.0.1)       activesupport       addressable       colorize       mime-types       open_uri_redirections  git   remote: git://github.com/theodi/data_kitten.git   revision: ddcbb677d7d993091a8f2ca44e537aa5cfd63bb8   specs:     data_kitten (1.2.0)       curb       datapackage       git       json       linkeddata       nokogiri       rake       rest-client  git   remote: git://github.com/theodi/juvia_rails.git   revision: 94f982aa8188a18bc0f37c16218c85e890d25294   specs:     juvia_rails (0.0.1)       rails (~> 3.2.1)  path   remote: vendor/gems/surveyor-1.4.0   specs:     surveyor (1.4.0)  gem   remote: https://rubygems.org/   specs:     aasm (3.1.1)     actionmailer (3.2.21)       actionpack (= 3.2.21)       mail (~> 2.5.4)     actionpack (3.2.21)       activemodel (= 3.2.21)       activesupport (= 3.2.21)       builder (~> 3.0.0)       erubis (~> 2.7.0)       journey (~> 1.0.4)       rack (~> 1.4.5)       rack-cache (~> 1.2)       rack-test (~> 0.6.1)       sprockets (~> 2.2.1)     activemodel (3.2.21)       activesupport (= 3.2.21)       builder (~> 3.0.0)     activerecord (3.2.21)       activemodel (= 3.2.21)       activesupport (= 3.2.21)       arel (~> 3.0.2)       tzinfo (~> 0.3.29)     activeresource (3.2.21)       activemodel (= 3.2.21)       activesupport (= 3.2.21)     activesupport (3.2.21)       i18n (~> 0.6, >= 0.6.4)       multi_json (~> 1.0)     addressable (2.3.5)     airbrake (4.1.0)       builder       multi_json     arel (3.0.3)     bcrypt (3.1.7)     bcrypt-ruby (3.1.5)       bcrypt (>= 3.1.3)     builder (3.0.4)     cancan (1.6.10)     capybara (2.4.1)       mime-types (>= 1.16)       nokogiri (>= 1.3.3)       rack (>= 1.0.0)       rack-test (>= 0.5.4)       xpath (~> 2.0)     celluloid (0.16.0)       timers (~> 4.0.0)     coderay (1.1.0)     coffee-rails (3.2.2)       coffee-script (>= 2.2.0)       railties (~> 3.2.0)     coffee-script (2.2.0)       coffee-script-source       execjs     coffee-script-source (1.7.0)     colorize (0.7.3)     commonjs (0.2.7)     connection_pool (2.1.0)     coveralls (0.7.0)       multi_json (~> 1.3)       rest-client       simplecov (>= 0.7)       term-ansicolor       thor     crack (0.4.2)       safe_yaml (~> 1.0.0)     cucumber (1.3.16)       builder (>= 2.1.2)       diff-lcs (>= 1.1.3)       gherkin (~> 2.12)       multi_json (>= 1.7.5, < 2.0)       multi_test (>= 0.1.1)     cucumber-rails (1.4.1)       capybara (>= 1.1.2, < 3)       cucumber (>= 1.3.8, < 2)       mime-types (~> 1.16)       nokogiri (~> 1.5)       rails (>= 3, < 5)     curb (0.8.8)     daemons (1.1.9)     database_cleaner (1.3.0)     datapackage (0.0.4)       colorize       json       json-schema       rest-client     delayed-plugins-airbrake (1.1.0)       airbrake       delayed_job     delayed_job (4.0.0)       activesupport (>= 3.0, < 4.1)     delayed_job_active_record (4.0.0)       activerecord (>= 3.0, < 4.1)       delayed_job (>= 3.0, < 4.1)     devise (3.0.3)       bcrypt-ruby (~> 3.0)       orm_adapter (~> 0.1)       railties (>= 3.2.6, < 5)       warden (~> 1.2.3)     diff-lcs (1.2.5)     docile (1.1.3)     domainatrix (0.0.11)       addressable     dotenv (0.10.0)     dotenv-rails (0.10.0)       dotenv (= 0.10.0)     ebnf (0.3.6)       haml (~> 4.0)       rdf (~> 1.1)       sxp (~> 0.1, >= 0.1.3)     equivalent-xml (0.5.1)       nokogiri (>= 1.4.3)     erubis (2.7.0)     eventmachine (1.0.3)     excon (0.31.0)     execjs (2.0.2)     factory_girl (4.4.0)       activesupport (>= 3.0.0)     factory_girl_rails (4.4.1)       factory_girl (~> 4.4.0)       railties (>= 3.0.0)     faraday (0.9.0)       multipart-post (>= 1.2, < 3)     fastercsv (1.5.5)     ffi (1.9.3)     fog (1.20.0)       builder       excon (~> 0.31.0)       formatador (~> 0.2.0)       mime-types       multi_json (~> 1.0)       net-scp (~> 1.1)       net-ssh (>= 2.1.3)       nokogiri (>= 1.5.11)     foreman (0.63.0)       dotenv (>= 0.7)       thor (>= 0.13.6)     formatador (0.2.4)     formtastic (2.1.1)       actionpack (~> 3.0)     gherkin (2.12.2)       multi_json (~> 1.3)     git (1.2.9.1)     google_drive (0.3.9)       nokogiri (>= 1.4.4, != 1.5.2, != 1.5.1)       oauth (>= 0.3.6)       oauth2 (>= 0.5.0)     guard (1.8.3)       formatador (>= 0.2.4)       listen (~> 1.3)       lumberjack (>= 1.0.2)       pry (>= 0.9.10)       thor (>= 0.14.6)     guard-test (1.0.0)       guard (>= 1.8)       test-unit (~> 2.2)     haml (4.0.5)       tilt     high_voltage (2.1.0)     hike (1.2.3)     hitimes (1.2.2)     htmlentities (4.3.2)     httparty (0.13.5)       json (~> 1.8)       multi_xml (>= 0.5.2)     i18n (0.6.11)     jbuilder (2.0.4)       activesupport (>= 3.0.0)       multi_json (>= 1.2.0)     journey (1.0.4)     jquery-rails (3.1.0)       railties (>= 3.0, < 5.0)       thor (>= 0.14, < 2.0)     json (1.8.3)     json-ld (1.1.6)       rdf (~> 1.1, >= 1.1.4)     json-schema (2.5.0)       addressable (~> 2.3)     jwt (0.1.13)       multi_json (>= 1.5)     kaminari (0.15.1)       actionpack (>= 3.0.0)       activesupport (>= 3.0.0)     less (2.3.3)       commonjs (~> 0.2.6)     less-rails (2.3.3)       actionpack (>= 3.1)       less (~> 2.3.1)     less-rails-bootstrap (2.3.3)       less-rails (~> 2.3.1)     libv8 (3.16.14.7)     linkeddata (1.1.1)       equivalent-xml (>= 0.4.0)       json-ld (>= 1.1.1)       nokogiri (>= 1.6.1)       rdf (>= 1.1.1)       rdf-aggregate-repo (>= 1.1.0)       rdf-isomorphic (>= 1.1.0)       rdf-json (>= 1.1.0)       rdf-microdata (>= 1.1.1)       rdf-n3 (>= 1.1.0)       rdf-rdfa (>= 1.1.1)       rdf-rdfxml (>= 1.1.0)       rdf-trig (>= 1.1.2)       rdf-trix (>= 1.1.0)       rdf-turtle (>= 1.1.2)       sparql (>= 1.1.2)       sparql-client (>= 1.1.1)     listen (1.3.1)       rb-fsevent (>= 0.9.3)       rb-inotify (>= 0.9)       rb-kqueue (>= 0.2)     lograge (0.2.2)       actionpack (>= 3)       activesupport (>= 3)       railties (>= 3)     logstash-event (1.2.02)     lumberjack (1.0.4)     mail (2.5.4)       mime-types (~> 1.16)       treetop (~> 1.4.8)     memoist (0.9.3)     metaclass (0.0.4)     method_source (0.8.2)     mime-types (1.25.1)     mini_portile (0.6.0)     mocha (1.1.0)       metaclass (~> 0.0.1)     multi_json (1.10.1)     multi_test (0.1.1)     multi_xml (0.5.5)     multipart-post (2.0.0)     mustache (0.99.4)     mysql2 (0.3.15)     net-http-persistent (1.9)     net-scp (1.1.2)       net-ssh (>= 2.6.5)     net-ssh (2.8.0)     netrc (0.7.7)     nokogiri (1.6.3.1)       mini_portile (= 0.6.0)     oauth (0.4.7)     oauth2 (0.9.3)       faraday (>= 0.8, < 0.10)       jwt (~> 0.1.8)       multi_json (~> 1.3)       multi_xml (~> 0.5)       rack (~> 1.2)     open_uri_redirections (0.1.4)     orm_adapter (0.5.0)     polyamorous (0.6.4)       activerecord (>= 3.0)     polyglot (0.3.5)     pry (0.9.12.6)       coderay (~> 1.0)       method_source (~> 0.8)       slop (~> 3.4)     pry-remote (0.1.8)       pry (~> 0.9)       slop (~> 3.0)     rabl (0.6.14)       activesupport (>= 2.3.14)       multi_json (~> 1.0)     rack (1.4.5)     rack-cache (1.2)       rack (>= 0.4)     rack-cors (0.4.0)     rack-linkeddata (1.1.0)       linkeddata (>= 1.1.0)       rack (>= 1.4)     rack-protection (1.5.3)       rack     rack-ssl (1.3.4)       rack     rack-test (0.6.2)       rack (>= 1.0)     rails (3.2.21)       actionmailer (= 3.2.21)       actionpack (= 3.2.21)       activerecord (= 3.2.21)       activeresource (= 3.2.21)       activesupport (= 3.2.21)       bundler (~> 1.0)       railties (= 3.2.21)     rails-footnotes (3.7.9)       rails (>= 3.0.0)     railties (3.2.21)       actionpack (= 3.2.21)       activesupport (= 3.2.21)       rack-ssl (~> 1.3.2)       rake (>= 0.8.7)       rdoc (~> 3.4)       thor (>= 0.14.6, < 2.0)     rake (10.4.0)     ransack (1.1.0)       actionpack (>= 3.0)       activerecord (>= 3.0)       polyamorous (~> 0.6.0)     rb-fsevent (0.9.4)     rb-inotify (0.9.3)       ffi (>= 0.5.0)     rb-kqueue (0.2.2)       ffi (>= 0.5.0)     rdf (1.1.6)     rdf-aggregate-repo (1.1.0)       rdf (>= 1.1)     rdf-isomorphic (1.1.0)       rdf (>= 1.1)     rdf-json (1.1.0)       rdf (>= 1.1.0)     rdf-microdata (1.1.2)       htmlentities (~> 4.3)       nokogiri (~> 1.6)       rdf (~> 1.1)       rdf-xsd (~> 1.1)     rdf-n3 (1.1.2)       rdf (~> 1.1, >= 1.1.5)     rdf-rdfa (1.1.4)       haml (~> 4.0)       htmlentities (~> 4.3)       rdf (~> 1.1, >= 1.1.6)       rdf-xsd (~> 1.1)     rdf-rdfxml (1.1.1)       rdf (~> 1.1)       rdf-rdfa (~> 1.1)       rdf-xsd (~> 1.1)     rdf-trig (1.1.3.1)       ebnf (~> 0.3, >= 0.3.5)       rdf (~> 1.1, >= 1.1.2.1)       rdf-turtle (~> 1.1, >= 1.1.3)     rdf-trix (1.1.0)       rdf (>= 1.1)     rdf-turtle (1.1.4)       ebnf (~> 0.3, >= 0.3.6)       rdf (~> 1.1, >= 1.1.4)     rdf-xsd (1.1.1)       rdf (~> 1.1)     rdoc (3.12.2)       json (~> 1.4)     redcarpet (3.1.1)     redis (3.2.1)     redis-namespace (1.5.2)       redis (~> 3.0, >= 3.0.4)     ref (1.0.5)     rest-client (1.7.2)       mime-types (>= 1.16, < 3.0)       netrc (~> 0.7)     ruby-prof (0.14.2)     rubyxl (3.3.3)       nokogiri (>= 1.4.4)       rubyzip (>= 1.1.6)     rubyzip (1.1.6)     safe_yaml (1.0.3)     sass (3.2.14)     sass-rails (3.2.6)       railties (~> 3.2.0)       sass (>= 3.1.10)       tilt (~> 1.3)     shoulda (3.5.0)       shoulda-context (~> 1.0, >= 1.0.1)       shoulda-matchers (>= 1.4.1, < 3.0)     shoulda-context (1.1.6)     shoulda-matchers (2.5.0)       activesupport (>= 3.0.0)     sidekiq (2.17.2)       celluloid (>= 0.15.2)       connection_pool (>= 1.0.0)       json       redis (>= 3.0.6)       redis-namespace (>= 1.3.1)     simplecov (0.8.2)       docile (~> 1.1.0)       multi_json       simplecov-html (~> 0.8.0)     simplecov-html (0.8.0)     sinatra (1.4.6)       rack (~> 1.4)       rack-protection (~> 1.4)       tilt (>= 1.3, < 3)     slop (3.4.7)     sparql (1.1.4)       builder (~> 3.0)       ebnf (~> 0.3, >= 0.3.5)       rdf (~> 1.1, >= 1.1.4)       rdf-aggregate-repo (~> 1.1, >= 1.1.0)       rdf-xsd (~> 1.1)       sparql-client (~> 1.1)       sxp (~> 0.1)     sparql-client (1.1.3)       net-http-persistent (~> 1.4)       rdf (~> 1.1)     sprockets (2.2.3)       hike (~> 1.2)       multi_json (~> 1.0)       rack (~> 1.0)       tilt (~> 1.1, != 1.3.0)     sqlite3 (1.3.9)     sxp (0.1.5)     term-ansicolor (1.3.0)       tins (~> 1.0)     terminal-notifier-guard (1.5.3)     test-unit (2.5.5)     therubyracer (0.12.1)       libv8 (~> 3.16.14.0)       ref     thin (1.6.2)       daemons (>= 1.0.9)       eventmachine (>= 1.0.0)       rack (>= 1.0.0)     thor (0.19.1)     tilt (1.4.1)     timecop (0.7.1)     timers (4.0.1)       hitimes     tins (1.1.0)     treetop (1.4.15)       polyglot       polyglot (>= 0.3.1)     twitter-bootstrap-rails-confirm (1.0.2)     tzinfo (0.3.42)     uglifier (2.4.0)       execjs (>= 0.3.0)       json (>= 1.8.0)     uuidtools (2.1.4)     validate_url (0.2.2)       activemodel (>= 3.0.0)       addressable     vcr (2.9.0)     warden (1.2.3)       rack (>= 1.0)     webmock (1.17.4)       addressable (>= 2.2.7)       crack (>= 0.3.2)     xpath (2.0.0)       nokogiri (~> 1.3)  platforms   ruby  dependencies   aasm   airbrake   alternate_rails!   cancan   coffee-rails (~> 3.2.1)   coveralls   csvlint!   cucumber-rails   data_kitten!   database_cleaner   delayed-plugins-airbrake   delayed_job_active_record   devise (= 3.0.3)   domainatrix   dotenv-rails   factory_girl_rails (~> 4.0)   fastercsv (~> 1.5.4)   fog   foreman   formtastic (~> 2.1.0)   google_drive   guard (~> 1.8.3)   guard-test   haml (>= 3.1.3)   high_voltage   httparty   jbuilder   jquery-rails   juvia_rails!   kaminari   less-rails   less-rails-bootstrap (~> 2.3.3)   linkeddata   lograge   logstash-event   memoist   mocha   mustache (= 0.99.4)   mysql2   pry   pry-remote   rabl (~> 0.6.13)   rack-cors   rack-linkeddata   rails (~> 3.2.21)   rails-footnotes (>= 3.7.9)   ransack   redcarpet   ruby-prof   rubyxl   sass   sass-rails (~> 3.2.3)   shoulda   shoulda-context   sidekiq   sinatra   sqlite3   surveyor!   terminal-notifier-guard   test-unit   therubyracer   thin   timecop   twitter-bootstrap-rails-confirm   uglifier (>= 1.0.3)   uuidtools (~> 2.1)   validate_url   vcr   webmock 

any ideas?


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -