zachfeldman / rubypress

Ruby interface for the WordPress XMLRPC API. Follows standard XML-RPC Documentation closely.
201 stars 54 forks source link

<module:XMLRPCRetryable>': uninitialized constant Net::ReadTim eout (NameError) #22

Closed ghost closed 10 years ago

ghost commented 10 years ago

I am getting the following error on Windows 7. Any idea how to fix this? Thanks.

C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rubypress-1.0.7/lib/rubypress/xml_rpc_r etryable.rb:7:in <module:XMLRPCRetryable>': uninitialized constant Net::ReadTim eout (NameError) from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rubypress-1.0.7/lib/rubypr ess/xml_rpc_retryable.rb:2:inmodule:Rubypress' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rubypress-1.0.7/lib/rubypr ess/xml_rpc_retryable.rb:1:in <top (required)>' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rubypress-1.0.7/lib/rubypr ess/client.rb:11:inrequire_relative' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rubypress-1.0.7/lib/rubypr ess/client.rb:11:in <top (required)>' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rubypress-1.0.7/lib/rubypr ess.rb:4:in<top (required)>' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ runtime.rb:72:in require' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ runtime.rb:72:inblock (2 levels) in require' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ runtime.rb:70:in each' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ runtime.rb:70:inblock in require' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ runtime.rb:59:in each' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ runtime.rb:59:inrequire' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler. rb:132:in require' from D:/Eclipse2/overheid_upgrade/config/application.rb:8:in<top (requ ired)>' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.18/lib/rails/ commands/runner.rb:43:in require' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.18/lib/rails/ commands/runner.rb:43:in<top (required)>' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.18/lib/rails/ commands.rb:64:in require' from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.18/lib/rails/ commands.rb:64:in<top (required)>' from script/rails:6:in require' from script/rails:6:in

'

ghost commented 10 years ago

Found the solution. Apparently Ruby 1.9.x doesn't have Net::ReadTimeout.

I changed line 7 to Net.const_defined?(:ReadTimeout)

Can this be fixed/added in the next release.

zachfeldman commented 10 years ago

Hi @nicksnels sure, why don't you submit a pull request?