Ruby Openssl not being found in NET::HTTP -


i'm getting following error:

/users/user_name/.rbenv/versions/1.8.7-p375/lib/ruby/1.8/net/https.rb:124:in `use_ssl=': uninitialized constant net::http::openssl (nameerror)

so, opened https file , changed 1 thing see happen, did this:

@ssl_context = ::openssl::ssl::sslcontext.new 

if can't see it, added :: openssl::ssl::sslcontext.new in method:

def use_ssl=(flag) 

and problem went away.

now can't edit source code directly ruby libs added following top of script act patch:

module net   class http      def use_ssl=(flag)       flag = (flag ? true : false)       raise ioerror, "use_ssl value changed, session started"\           if started? , @use_ssl != flag       if flag , not @ssl_context         @ssl_context = ::openssl::ssl::sslcontext.new       end       @use_ssl = flag     end   end end 

however i'm getting error:

scripts/get_social_data.rb:27:in `use_ssl=': uninitialized constant openssl (nameerror)

despite having done:

require 'openssl' 

at top of script.

why openssl not existing though i'm requiring it?

i'm guessing i'm missing somthing can't see it.

edit:

well, noticed openssl (i'm maintaining project) in gemfile, i'm pretty sure it's not supposed there, uninstalled it's still not working.

ok, so, after looking around internet , trying various things found fix issue, had re-install ruby 1.8.7-p375 using following command:

ruby_configure_opts=--with-openssl-dir= rbenv install 1.8.7-p375

the openssldir can found, @ least on osx , installed homebrew this:

brew list openssl

you'll bunch of dir's, copy bit that's in of them, might somthing this:

/usr/local/cellar/openssl/1.0.2h


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -