jnunemaker / httparty

:tada: Makes http fun again!
MIT License
5.81k stars 963 forks source link

Undefined method 'multiple_choices?' , using JRuby and compat.version=2.0 #202

Closed TheReincarnator closed 11 years ago

TheReincarnator commented 11 years ago

The commit a0a07c508b476df4454c6b2caaabe2a793c2b864 breaks JRuby 2.0 with "compat.version=2.0" with HTTParty HEAD, at least in my situation, with the following error:

NameError: undefined method 'multiple_choices?' for class 'HTTParty::Response'
    alias_method at org/jruby/RubyModule.java:2270
    Response at /home/thomas/.rvm/gems/jruby-1.7.3@rails3.2/bundler/gems/httparty-1fde99ba8aa4/lib/httparty/response.rb:45
    HTTParty at /home/thomas/.rvm/gems/jruby-1.7.3@rails3.2/bundler/gems/httparty-1fde99ba8aa4/lib/httparty/response.rb:2
    (root) at /home/thomas/.rvm/gems/jruby-1.7.3@rails3.2/bundler/gems/httparty-1fde99ba8aa4/lib/httparty/response.rb:1
    require at org/jruby/RubyKernel.java:1027
    (root) at /home/thomas/.rvm/gems/jruby-1.7.3@rails3.2/bundler/gems/httparty-1fde99ba8aa4/lib/httparty.rb:1
    require at org/jruby/RubyKernel.java:1027
    (root) at /home/thomas/.rvm/gems/jruby-1.7.3@rails3.2/bundler/gems/httparty-1fde99ba8aa4/lib/httparty.rb:534
    each at org/jruby/RubyArray.java:1613
    (root) at /home/thomas/.rvm/gems/jruby-1.7.3@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:1
    each at org/jruby/RubyArray.java:1613
    require at /home/thomas/.rvm/gems/jruby-1.7.3@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72
    require at /home/thomas/.rvm/gems/jruby-1.7.3@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70
    require at /home/thomas/.rvm/gems/jruby-1.7.3@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59
    require at org/jruby/RubyKernel.java:1027
    require at /home/thomas/.rvm/gems/jruby-1.7.3@global/gems/bundler-1.3.5/lib/bundler.rb:132
    tap at org/jruby/RubyKernel.java:1771
    (root) at /home/thomas/work/unitymedia/ume-selfcare/config/application.rb:9
    require at org/jruby/RubyKernel.java:1027
    (root) at script/rails:6
TheReincarnator commented 11 years ago

This is my Gemfile:

source 'https://rubygems.org'

gem 'rails'
gem 'jquery-rails'
gem 'couchmodel', :require => 'couch_model'
gem 'haml'
gem 'simple-navigation'
gem 'maruku'
gem 'will_paginate'
gem 'httparty
gem 'newrelic_rpm'

if RUBY_PLATFORM =~ /java/
  gem 'fastercsv'
  gem 'json-jruby'
  gem 'jruby-openssl', :require => false
  gem 'jruby-jars'
  gem 'activerecord-jdbc-adapter'
  gem 'activerecord-jdbcsqlite3-adapter'
  gem 'activerecord-jdbcmysql-adapter'
  gem 'jdbc-mysql'
  gem 'rubyzip', :require => 'zip/zipfilesystem'
else
  gem 'sqlite3-ruby', :require => 'sqlite3'
  gem 'mysql2'
end

group :development, :test do
  gem 'rspec-rails'
  gem 'capybara'
  gem 'capybara-webkit', :git => 'git://github.com/thoughtbot/capybara-webkit.git'
  gem 'launchy'
  gem 'spork'
  gem 'warbler'
  gem 'term-ansicolor'
  gem 'mongrel', '>= 1.2.0.pre2', :platforms => 'mri'
  gem 'pry'
  gem 'ruby-debug', :platforms => ['ruby_18', 'jruby']
  if RUBY_PLATFORM =~ /java/
    gem 'ruby-debug19', :require => 'ruby-debug', :platforms => 'ruby_19'
  else
    gem 'debugger'
  end
end

group :assets do
  gem 'sass-rails'
  gem 'yui-compressor'
  gem 'uglifier', :require => 'uglifier'
end

I am using JRuby 1.7.3, Rails 3.2.

nixpulvis commented 11 years ago

Looks like JRuby 2.0 compatibility is missing the name change in Net::HTTP. see #193 for more information.

nixpulvis commented 11 years ago

Temporary fix in #204.

nixpulvis commented 11 years ago

I posted this as an issue in JRuby, adding pressure to add the 2.0 stdlib. We'll have to wait to see when that gets added in. Maybe in 1.7.4 :pray:

jnunemaker commented 11 years ago

Merged #204