I'm using the ruby-fedora gem to fetch information from my database
Fedora::Repository.instance.fetch_content
I'm positive my code works, because there were no problems before I updated to Ruby 2.1.1. When I execute the code to fetch data, the code from the gem itself (bundle/ruby/2.1.0/gems/ruby-fedora-1.0.5/lib/fedora/connection.rb) produces following error:
undefined method `use_ssl' for #<Net::HTTP 127.0.0.1:8080 open=false>
bundle/ruby/2.1.0/gems/ruby-fedora-1.0.5/lib/fedora/connection.rb:191:in `http'
bundle/ruby/2.1.0/gems/ruby-fedora-1.0.5/lib/fedora/connection.rb:152:in `request'
Anyone encountered something like this before? Could it be due to gem incompatibility?
EDIT: I edited the gem code and the line where the problem occurs is:
# Creates new Net::HTTP instance for communication with
# remote service and resources.
def http
http = Net::HTTP.new(@site.host, @site.port)
http.use_ssl = @site.is_a?(URI::HTTPS)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl <--- THIS LINE
http
end
When I replace the function with the following one, everything works fine (as I don't use HTTPS)
# Creates new Net::HTTP instance for communication with
# remote service and resources.
def http
http = Net::HTTP.new(@site.host, @site.port)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @site.is_a?(URI::HTTPS)
http
end