havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.3, 2.4.5, 2.3.8, 2.6.0-rc2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
<ixti> isene: where do you get `false`?
<ixti> basically it means `fileutils` was already required
<uplime> isene: are you using something like pry?
jottr has quit [Ping timeout: 246 seconds]
<isene> I tried both irb and pry and get the same (as the first command)
ellcs has quit [Ping timeout: 250 seconds]
<havenwood> isene: It's always `false` in Pry, since Pry requires FileUtils. In IRB it'd usually be `true` the first time.
cnsvc_ has joined #ruby
<havenwood> isene: Maybe Ubuntu packagers are doing `irb -rfileutils` or patched IRB. Assuming it's not causing you any issue? Just curious?
<uplime> fwiw it works for me: https://clbin.com/Ci82V
cnsvc_ has quit [Ping timeout: 256 seconds]
tiff has joined #ruby
<isene> Hmm.. it seems it doesn't cause me any issues - I have an issue that I'm wrestling with, and I thought this could be an issue but it's not. Thanks for the input regarding pry and fileutils, though - I didn't know that
nchambers has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
<isene> I have a mail fetch script that has run more than 5 million times without a hickup. Now as I upgraded from Ubuntu 18.04 to 18.10 (with Ruby 2.5), I get this when trying to login to a remote (gmail) server:
<isene> OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate)
<isene> from /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock'
Some-body_ has joined #ruby
DarthGandalf has quit [Ping timeout: 264 seconds]
Some-body_ is now known as DarthGandalf
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
uplime has quit [Ping timeout: 250 seconds]
<havenwood> isene: Did you add your self-signed cert .crt to /usr/local/share/ca-certificates and c_rehash or whatever?
<havenwood> isene: Normally you'd install the update-ca-certificates package to update certs, but looks like you're using a self signed one?
<isene> havenwood: I'm clueless in this - my script has worked just nicely before and now it fails... baby steps please?
cnsvc_ has joined #ruby
<havenwood> isene: So this isn't a Ruby issue, but your OS has a list of certs it trusts. There's an apt package called update-ca-certificates that folk usually use to update trusted certs.
<isene> There is no package called update-ca-certificates on Ubuntu 18.10 :-/
<isene> And also; ca-certificates is already the newest version (20180409)
<havenwood> isene: That's what I meant, ca-certificates.
<havenwood> (I forgot the package name.)
<isene> :-)
lytol has quit [Remote host closed the connection]
<isene> So, how do I fix the error that my script encounters, then?
<havenwood> isene: In your case, an up-to-date list of trusted certs doesn't help, because it's balking at a self-signed cert.
<havenwood> isene: "certificate verify failed (self signed certificate)"
<havenwood> isene: So it's up to you to trust your own cert.
<isene> Do I need that to login to gmail?
<isene> Or how do I make me trust my cert here?
<isene> "me" as in "my system"
<havenwood> isene: It's pretty offtopic for this channel, but the good folk in #ubuntu can probably guide you.
<havenwood> isene: Generally, try `apropos certificates`, and then check any manpages that seem relevant. Like: man update-ca-certificates
cthulchu has quit [Ping timeout: 245 seconds]
<havenwood> isene: It's likely put a cert in a folder then run a command. I don't recall offhand or I'd just say.
<havenwood> isene: Or you're not supposed to be using a self-signed cert. That's another possibility, but the reason Ruby is balking is it doesn't know about this cert.
<havenwood> isene: I see you mention Gmail, which makes me think something is amiss with a self-signed cert.
<havenwood> isene: Check the cert outside Ruby, but it's likely a system problem rather than Ruby-related.
<isene> Thanks for trying to help me here... So, how can I check the cert outside Ruby?
<havenwood> isene: E.g.: openssl s_client -showcerts -connect gmail.com:https
<havenwood> isene: Take a look at the cert and see if you can spot any issues. You might want to read up a bit on certs.
<isene> wooha - lots of stuff :-)
<isene> Hmmm... doesn't seem bad - can't see any issues :-/
Puffball has joined #ruby
<havenwood> isene: Is there a certificate chain? You changed "gmail.com" to what you're really hitting?
cnsvc_ has quit [Ping timeout: 256 seconds]
RougeR has quit [Ping timeout: 250 seconds]
<havenwood> isene: If you can share your Ruby code, folk here might be better able to guess what's going on.
<havenwood> ua: Merged
jottr has joined #ruby
eminencehc has quit [Ping timeout: 250 seconds]
jthomas1 has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 246 seconds]
Tharbakim has joined #ruby
DTZUZO has joined #ruby
<isene> havenwood: It's failing on this: $imap_from = Net::IMAP.new("imap.gmail.com", port="993", usessl="true")
r29v has quit [Quit: r29v]
GodFather has quit [Ping timeout: 246 seconds]
hutch has joined #ruby
DTZUZO has quit [Ping timeout: 250 seconds]
d10n-work has quit [Quit: Connection closed for inactivity]
tiff has joined #ruby
davidw has quit [Ping timeout: 240 seconds]
phaul has quit [Quit: bye]
lunarkitty7 has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has quit [Remote host closed the connection]
DTZUZO has joined #ruby
roshanavand has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
cnsvc_ has joined #ruby
Arkantos has joined #ruby
s3nd1v0g1us has quit [Read error: Connection reset by peer]
s3nd1v0g1us has joined #ruby
cats has quit [Ping timeout: 250 seconds]
sylario has quit [Quit: Connection closed for inactivity]
cats has joined #ruby
connermcd has joined #ruby
nertzy has quit [Ping timeout: 245 seconds]
connermcd has quit [Quit: WeeChat 2.3]
Xenosine has quit [Ping timeout: 268 seconds]
connermcd has joined #ruby
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
exchgr` is now known as exchgr
DTZUZO has quit [Ping timeout: 244 seconds]
roshanavand has quit [Remote host closed the connection]
kapil____ has joined #ruby
roshanavand has joined #ruby
Puffball has quit [Remote host closed the connection]
eminencehc has joined #ruby
cd has quit [Quit: cd]
jottr has joined #ruby
Puffball has joined #ruby
eminencehc has quit [Ping timeout: 240 seconds]
\void has joined #ruby
m0w has quit [Ping timeout: 240 seconds]
hutch has quit [Ping timeout: 246 seconds]
AJA4350 has quit [Quit: AJA4350]
ellcs has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 250 seconds]
nickjj has quit [Read error: Connection reset by peer]
jthomas1 has joined #ruby
code_zombie has quit [Quit: Leaving]
jthomas1 has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s3nd1v0g1us has quit [Quit: WeeChat 2.2]
hutch has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
tiff has joined #ruby
Arkantos has joined #ruby
cnsvc_ has joined #ruby
hutch has quit [Ping timeout: 246 seconds]
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc_ has quit [Ping timeout: 256 seconds]
connermcd has quit [Quit: WeeChat 2.3]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
agent_white has quit [Remote host closed the connection]
cnsvc_ has joined #ruby
ellcs has quit [Ping timeout: 268 seconds]
hutch has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
gix has quit [Ping timeout: 250 seconds]
houhoulis has joined #ruby
cats has quit [Ping timeout: 268 seconds]
Exuma has joined #ruby
cats has joined #ruby
elphe has joined #ruby
hutch has quit [Ping timeout: 240 seconds]
darkhanb has joined #ruby
Dreamer3 has quit [Quit: Leaving...]
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Exuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Renich has joined #ruby
hutch has joined #ruby
venmx has joined #ruby
eminencehc has joined #ruby
sauvin has joined #ruby
jottr has joined #ruby
Renich has quit [Quit: Renich]
eminencehc has quit [Ping timeout: 272 seconds]
Renich has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
hutch has quit [Ping timeout: 272 seconds]
Exuma has joined #ruby
houhoulis has quit [Remote host closed the connection]
venmx has quit [Ping timeout: 246 seconds]
dellavg_ has joined #ruby
Exuma has quit [Ping timeout: 250 seconds]
venmx has joined #ruby
themsay has quit [Ping timeout: 246 seconds]
themsay has joined #ruby
nchambers has quit [Quit: WeeChat 2.2]
gambl0r3 has joined #ruby
gambl0r3 has left #ruby ["Leaving"]
KeyJoo has joined #ruby
Inline has quit [Quit: Leaving]
Exuma has joined #ruby
paranoicsan has joined #ruby
drbrain has quit [Ping timeout: 272 seconds]
drbrain has joined #ruby
Fusl has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
Fusl has joined #ruby
aupadhye has joined #ruby
reber has joined #ruby
kt2 has joined #ruby
endemic has quit [Ping timeout: 250 seconds]
kt2 has quit [Quit: kt2]
endemic has joined #ruby
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
za1b1tsu has joined #ruby
samort7 has quit [Read error: Connection reset by peer]
\void has quit [Quit: So long, and thanks for all the fish.]
prestorium has joined #ruby
eminencehc has joined #ruby
bjpenn has quit [Ping timeout: 244 seconds]
jottr has joined #ruby
eminencehc has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
DTZUZO has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
Dbugger has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
irdr has quit [Remote host closed the connection]
Dreamer3_ has joined #ruby
irdr has joined #ruby
wolfshappen has quit [Ping timeout: 250 seconds]
wolfshappen has joined #ruby
clemens3_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
paranoicsan is now known as paranoicsan[Away
paranoicsan[Away has quit [Quit: paranoicsan[Away]
prestorium has quit [Quit: prestorium]
prestorium has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
jsc has joined #ruby
jsc is now known as status402
dbz has joined #ruby
clemens3_ has quit [Ping timeout: 246 seconds]
dbz has quit [Ping timeout: 244 seconds]
prestorium has quit [Quit: prestorium]
prestorium has joined #ruby
tiff has joined #ruby
jottr has joined #ruby
tiff has quit [Client Quit]
Dbugger has quit [Quit: Leaving]
reber has quit [Remote host closed the connection]
ixti has quit [Quit: WeeChat 2.3]
jottr has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
phaul has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
elphe has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
m0w has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
neuraload has joined #ruby
status402_ has joined #ruby
status402 has quit [Read error: Connection reset by peer]
conta has joined #ruby
mikecmpbll has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
neuraload has quit [Quit: This computer has gone to sleep]
elphe has joined #ruby
jottr has joined #ruby
jottr has quit [Client Quit]
za1b1tsu has quit [Ping timeout: 250 seconds]
neuraload has joined #ruby
conta has quit [Quit: conta]
cnsvc_ has quit [Ping timeout: 256 seconds]
dhollin3 has joined #ruby
dhollinger has quit [Ping timeout: 250 seconds]
jthomas1 has joined #ruby
<isene> back to the issue at hand after a night's sleep; Anyone knows how to ensure Ruby looks for certificates in the correct place?
jthomas1 has quit [Ping timeout: 246 seconds]
Guest49234 has joined #ruby
neuraload has quit [Ping timeout: 240 seconds]
neuraload has joined #ruby
cnsvc_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
nickjj has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
ellcs has joined #ruby
neuraload has quit [Ping timeout: 245 seconds]
neuraload has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
trif has joined #ruby
trif has quit [Client Quit]
trif has joined #ruby
trif has quit [Client Quit]
<Iambchop> isene: are you using ubuntu's packaged, build your own, 3rd party package? you used imap.gmail.com:993 on your s_client test? the line you said it's failing on "imap.gmail.com" isn't in the script you posted (ms[0][0] is in the script). test with just a minimal example e.g. $ ruby -r net/imap -e 'p Net::IMAP.new("imap.gmail.com", 993, ssl: true)'
eminencehc has joined #ruby
neuraload has quit [Quit: This computer has gone to sleep]
Guest78161 has joined #ruby
trif has joined #ruby
eminencehc has quit [Ping timeout: 272 seconds]
neuraload has joined #ruby
dbz has joined #ruby
trif has quit [Quit: leaving]
trif has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
ellcs has quit [Ping timeout: 250 seconds]
dbz has quit [Remote host closed the connection]
neuraload has quit [Quit: This computer has gone to sleep]
trif has quit [Quit: leaving]
deathwishdave has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
AJA4350 has joined #ruby
trif has joined #ruby
themsay has quit [Ping timeout: 244 seconds]
paranoicsan has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
neuraload has joined #ruby
lucasb has joined #ruby
elphe has joined #ruby
trif has quit [Quit: leaving]
trif has joined #ruby
neuraload has quit [Quit: This computer has gone to sleep]
rippa has joined #ruby
DTZUZO has joined #ruby
neuraload has joined #ruby
neuraload has quit [Client Quit]
ellcs has joined #ruby
Guest49234 has quit [Ping timeout: 250 seconds]
Guest49234 has joined #ruby
Guest49234 has quit [Ping timeout: 268 seconds]
ellcs has quit [Ping timeout: 252 seconds]
neuraload has joined #ruby
neuraload has quit [Quit: Leaving]
Guest49234 has joined #ruby
Guest49234 has quit [Ping timeout: 250 seconds]
paranoicsan is now known as paranoicsan[Away
nickjj has quit [Read error: Connection reset by peer]
nickjj has joined #ruby
nickjj has quit [Read error: Connection reset by peer]
nickjj has joined #ruby
paranoicsan[Away is now known as paranoicsan
paranoicsan has quit [Quit: paranoicsan]
kapil____ has quit [Quit: Connection closed for inactivity]
dhollin3 is now known as dhollinger
jthomas1 has joined #ruby
kapil____ has joined #ruby
jthomas1 has quit [Ping timeout: 244 seconds]
Guest49234 has joined #ruby
venmx has quit [Ping timeout: 268 seconds]
Guest49234 has quit [Ping timeout: 246 seconds]
<marz_d`ghostman> Does Logger automatically capture stderr and stdout if you set it to FATAL?
conta has joined #ruby
bmurt has joined #ruby
Guest49234 has joined #ruby
cnsvc_ has joined #ruby
Inline has joined #ruby
Guest78161 has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
nowhere_man has joined #ruby
roshanavand has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
ua has quit [Read error: Connection reset by peer]
dinfuehr has joined #ruby
connermcd has joined #ruby
ua has joined #ruby
Guest49234 has quit [Ping timeout: 244 seconds]
Guest49234 has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
neuraload has joined #ruby
Arkantos has joined #ruby
jcalla has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
DTZUZO has quit [Ping timeout: 250 seconds]
status402_ has quit [Quit: status402_]
chouhoulis has quit [Ping timeout: 246 seconds]
DTZUZO has joined #ruby
postmodern has quit [Quit: Leaving]
chouhoulis has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
Rapture has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
<isene> OK, I have checked and verified left, right & center. This is a Ruby specific issue with my setup after upgrading from Ubuntu 18.04 to 18.10. It seems some package was broken, but I don't understand which (or if there is another Ruby issue relating to upgrade to 2.5). Here's my testing results:
<isene> Checking with openssl raw ' openssl s_client -showcerts -connect imap.gmail.com -port 993 ' all certs checks out with verify=1
<isene> I have tested logging in with the correct username/pw with Python, all ok
<isene> But when I do this simple thing in irb/pry:
<isene> require 'net/imap'
mostlybadfly has joined #ruby
<isene> $imap_from = Net::IMAP.new("imap.gmail.com", port="993", usessl="true")
<isene> I get this:
<isene> OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate)
<isene> from /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock'
<isene> There is no issue with the certificates (as verified with openssl and python). It may be that Ruby is looking for certificates in the wrong place or something?
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
venmx has joined #ruby
<isene> As you see, I don't even get to logging in to gmail with un/pw - as it fails on connect
<isene> lambarena: ^^
<phaul> you could try scanning through strace of pry vs python. Looking for paths they open for certs. It's a long shot but it could prove you right, or give more hints
chouhoulis has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
<isene> phaul: I could do that (will check when I get home - I am on an airplane as I write with a spartan connection)
<phaul> well, it's just an idea, usually strace outputs thousands of lines of logs, so it helps if you have something to grp for. like "cert"
<phaul> *grep
<isene> phaul: Yup :-)
chouhoulis has quit [Ping timeout: 246 seconds]
<isene> lambarena: The very basic ' ruby -r net/imap -e 'p Net::IMAP.new("imap.gmail.com", 993, ssl: true)' ' returns the same error as the pry/irb example; /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate) (OpenSSL::SSL::SSLError)
elphe has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
<isene> phaul: Seems that was a really good idea to use strace. Check this: http://dpaste.com/26N1H17
<isene> Ruby is looking for stuff in the wrong places. How do I fix this the right way?
<isene> (about to land - will be afk for an hour or so)
chouhoulis has joined #ruby
DTZUZO has quit [Ping timeout: 246 seconds]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
d10n-work has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
eminencehc has joined #ruby
chouhoulis has quit [Ping timeout: 268 seconds]
chouhoulis has joined #ruby
eminencehc has quit [Ping timeout: 246 seconds]
eminencehc has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
cd has joined #ruby
hutch has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
nchambers has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 272 seconds]
chouhoulis has joined #ruby
spacesuitdiver has joined #ruby
jthomas1 has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
chouhoulis has joined #ruby
spacesuitdiver has quit [Client Quit]
chouhoulis has quit [Ping timeout: 268 seconds]
chouhoulis has joined #ruby
jthomas1 has quit [Ping timeout: 246 seconds]
neuraload has quit [Ping timeout: 245 seconds]
jthomas1 has joined #ruby
neuraload has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
cnsvc_ has joined #ruby
cow[moo] has joined #ruby
elphe has joined #ruby
chouhoulis has quit [Ping timeout: 272 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
elphe has quit [Ping timeout: 245 seconds]
twobitsprite has joined #ruby
chouhoulis has joined #ruby
akaiiro has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Ping timeout: 245 seconds]
tjarvis has joined #ruby
tjarvis has quit [Client Quit]
ellcs has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
prestorium has quit [Quit: prestorium]
davidw has joined #ruby
DTZUZO has joined #ruby
maryo has joined #ruby
samort7 has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
Mike11 has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
za1b1tsu has joined #ruby
<marz_d`ghostman> If a thread raises an error like TypeError: no implicit converison of nil into String, how do I capture it for logging?
elphe has joined #ruby
maryo has quit [Remote host closed the connection]
maryo has joined #ruby
znz_jp has quit [Remote host closed the connection]
znz_jp has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
\void has joined #ruby
Guest49234 has quit [Ping timeout: 246 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tjarvis has joined #ruby
cow[moo] is now known as cow[away]
m0w has quit [Ping timeout: 250 seconds]
spacesuitdiver has joined #ruby
<KrzaQ> is there somethign like .first_or(val) for arrays/enumerables? I want to streamline getting data from containers
mikecmpbll has joined #ruby
reber has joined #ruby
<marz_d`ghostman> How do I capture errors from a thread. I tried: https://gist.github.com/marzdgzmn/da9c0eb69a6fa9647531e8ffbeecf2eb/edit. But it does't seem to work
reber has quit [Remote host closed the connection]
nowhere_man has joined #ruby
spacesuitdiver has quit [Quit: Textual IRC Client: www.textualapp.com]
tjarvis has quit [Ping timeout: 246 seconds]
<Iambchop> KrzaQ: when should it return val instead of first (e.g. only if array is empty, only if first is nil, only if first is falsey)?
<Iambchop> &>> [([1,2].first || 3), ([nil,4].first || 5)]
<rubydoc> # => [1, 5] (https://carc.in/#/r/5u7u)
ellcs has quit [Ping timeout: 250 seconds]
<KrzaQ> good point
<KrzaQ> In my case I wanted to get a proper value, but anything that would allow me getting a point-free chain would be preferred over wrapping the chain in parens or naming variables
<KrzaQ> :P
darkhanb has joined #ruby
<phaul> point free brings back memories from my haskell days
<phaul> ppl also called it pointless style :)
<nchambers> haha
<KrzaQ> I would say it makes for very clear intent if you're doing just data manipulation and can fit it short code
<KrzaQ> I guess I can yield_self on the array to avoid polluting the scope
dbz has joined #ruby
aupadhye has quit [Quit: Leaving]
<marz_d`ghostman> Can someone suggest a good article or book about threads in ruby like how to capture its stdout and stderr.
<havenwood> marz_d`ghostman: Your gist link is 404ing. What did you try?
<KrzaQ> havenwood: remove /edit.
<havenwood> KrzaQ: Use #fetch for that. :)
* KrzaQ blinks
<KrzaQ> heh, I totally forgot about that
<havenwood> KrzaQ: array.fetch(0, 3)
<KrzaQ> thanks, that's exactly what I wanted
<havenwood> KrzaQ: yeah, I usually think Hash with #fetch too. you're welcome.
<havenwood> I do think #fetch is generally underused. With ENV too.
<KrzaQ> I use it quite a lot, actually, but rarely with arrays
akaiiro has joined #ruby
* havenwood nods
<havenwood> same
<KrzaQ> recent advent of code made me wish for array fetch that wouldn't interpret negative indices
Dbugger has joined #ruby
<KrzaQ> I mean, it was trivial to monkey patch it into the class, but I would prefer not having to do that (and not doing it outside of a toy puzzle code)
m0w has joined #ruby
Renich has quit [Ping timeout: 250 seconds]
DTZUZO has quit [Ping timeout: 244 seconds]
neuraload has quit [Quit: This computer has gone to sleep]
Renich has joined #ruby
cthulchu_ has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
neuraload has joined #ruby
Nicmavr has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
bmurt has joined #ruby
dbz has quit [Remote host closed the connection]
brendan- has joined #ruby
GodFather has quit [Ping timeout: 264 seconds]
reber has joined #ruby
venmx has quit [Quit: leaving]
venmx has joined #ruby
orbyt_ has joined #ruby
spacesuitdiver has joined #ruby
Mike11 has quit [Ping timeout: 250 seconds]
maryo has quit [Remote host closed the connection]
maryo has joined #ruby
venmx has quit [Ping timeout: 250 seconds]
sauvin has quit [Remote host closed the connection]
neuraload has quit [Quit: This computer has gone to sleep]
<havenwood> KrzaQ: what should the return value be for a negative index?
<KrzaQ> in the case I wanted? nil, basically I wanted to build a grid out of arrays, and to cut the edge cases by having out-of-bounds access return nil
salasrod has quit [Quit: /quit]
salasrod has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maryo has quit [Ping timeout: 272 seconds]
cnsvc_ has joined #ruby
Chew has quit [Quit: Connection closed for inactivity]
deathwishdave has joined #ruby
deathwishdave has quit [Client Quit]
\void has quit [Quit: So long, and thanks for all the fish.]
\void has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
spacesui_ has joined #ruby
deathwishdave has joined #ruby
deathwishdave has quit [Client Quit]
spacesuitdiver has quit [Ping timeout: 240 seconds]
tjarvis has joined #ruby
connermcd has quit [Quit: WeeChat 2.3]
Dbugger has quit [Remote host closed the connection]
MyMind has joined #ruby
Sembei has quit [Ping timeout: 250 seconds]
connermcd has joined #ruby
connermcd has quit [Client Quit]
connermcd has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
neuraload has joined #ruby
connermcd has quit [Client Quit]
neuraload has quit [Client Quit]
Arkantos has quit [Quit: Textual IRC Client: www.textualapp.com]
DTZUZO has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
twobitsprite has quit [Ping timeout: 250 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
onkelhotte has joined #ruby
dbz has joined #ruby
<isene> phaul: I'm back. And with a bit more research it seems that Ruby is looking for a cert.pem in /usr/lib/ssl/ that doesn't exist (this may be just one of several issues). I tried prging ruby completely and reinstalling it - to no use. wtf?
dellavg_ has quit [Ping timeout: 240 seconds]
dbz has quit [Ping timeout: 250 seconds]
elphe has quit [Ping timeout: 240 seconds]
<havenwood> isene: What's your DEFAULT_CERT_DIR?: ruby -ropenssl -e "p OpenSSL::X509::DEFAULT_CERT_DIR"
<havenwood> isene: If the cert is there, c_rehash that dir.
<havenwood> isene: See: man c_rehash
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
spacesui_ has quit [Ping timeout: 268 seconds]
<havenwood> isene: E.g.: c_rehash /usr/lib/ssl/certs
cnsvc_ has joined #ruby
elphe has joined #ruby
<isene> havenwood: command returns "/usr/lib/ssl/certs"
<havenwood> isene: I think that's standard on Ubuntu. Checking here I get the same.
ubuntuisloved has joined #ruby
<isene> then I did the c_rehash and got:
<isene> Doing /usr/lib/ssl/certs
<havenwood> isene: An aside, but did you already run?: sudo update-ca-certificates
<isene> "WARNING: Skipping duplicate certificate ca-certificates.crt"
spacesuitdiver has joined #ruby
<isene> Yes, I did update-ca-certificates
<ubuntuisloved> I'm taking over a project with pundit but I cannot seem to figure out how to get my user authorized with it. There are api routes and such but none actually throw up a user auth screen. Any direction you can send me to look for would be very helpful.
<havenwood> ?rails ubuntuisloved
<ruby[bot]> ubuntuisloved: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
elphe has quit [Ping timeout: 245 seconds]
<ubuntuisloved> k
<isene> after yet another update-ca-certificates and the c_rehash I still get the same :-/
<havenwood> isene: Is the cert you're looking for in /usr/lib/ssl/certs at all?
<havenwood> Hrm
<isene> Well, openssl finds it and python runs everything just fine... how do I see if it's there (I'm not well versed in certificates and such)?
onkelhotte has quit [Quit: WeeChat 2.2]
<havenwood> isene: It'd be one of the .pem files in that dir. You could put it there then c_rehash if it's not there.
SoftDed has joined #ruby
SoftDed has quit [Excess Flood]
neuraload has joined #ruby
<havenwood> isene: Here's how you can just load a .pem directly without getting it setup in /usr/lib/ssl/certs at all: https://mislav.net/2013/07/ruby-openssl/#it-was-a-custom-certificate-that-we-use-internally-in-our-organization-that-my-program-cant-verify
<havenwood> isene: That ^ writeup mislav did also has some background reading about certs in the context of Ruby.
<isene> The cert I need is for imap.gmail.com - how do I find it in that dir? I have no idea what I'm looking for even
<isene> Would you want to see the full strace of ruby -r net/imap -e 'p Net::IMAP.new("imap.gmail.com", 993, ssl: true)' ?
twobitsprite has joined #ruby
lxsameer has joined #ruby
<havenwood> isene: Usually you grab a CA certificate store in .pem format from curl or mozilla that has a whitelist of certificate authority certs. pdate-ca-certificates is the automagical way to do that.
<havenwood> isene: For example: http://curl.haxx.se/ca/cacert.pem
spacesui_ has joined #ruby
<havenwood> isene: In my experience it usually *just works* after a: sudo update-ca-certificates
<isene> So, does that include the imap.gmail.com? You see, this was working just beautifully since 10 years back, and my mail_fetch.rb has been running more than 5 million time since then without a glitch. No stuff is wrecked.
<isene> *Now
<isene> And it DOES work with openssl and with Python, and That is what drives me nuts here
spacesuitdiver has quit [Ping timeout: 268 seconds]
<havenwood> isene: It looks like Gmail used to be configured with a self-signed cert - one that wouldn't be in a cert bundle. Hrm. This isn't my area of expertise so I'm not spotting the issue.
<isene> But how can openssl and python do this without an issue while ruby balks? mepuzzled
elphe has joined #ruby
<havenwood> isene: What's the Python equivalent of OpenSSL::X509::DEFAULT_CERT_FILE pointing at?
<isene> And all of a sudden as a result of upgrading from Ubuntu 18.04 to 18.10
<havenwood> isene: OS upgrades tend to mess up certs - as ones get dropped and added. :P
<isene> ... that I don't know as I'm totally noob in python. Let me googøe
<isene> google
elphe has quit [Ping timeout: 250 seconds]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<isene> Commands here https://stackoverflow.com/questions/36449336/what-is-my-openssl-and-ssl-default-ca-certs-path tells me that python finds the certs here: /etc/ssl/certs/ca-certificates.crt and logs in to imap.gmail.com just fine
<isene> So, it cannot be a certificate issue - it must be a ruby issue :-/
<havenwood> isene: Does it work if you set: ENV['SSL_CERT_FILE'] = '/etc/ssl/certs/ca-certificates.crt'
<havenwood> isene: If so, from your shell you can: export SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
<havenwood> isene: Someone else here might have a cleaner suggestion.
<havenwood> isene: I'm tempted to say just convert that .crt to a .pem, put it in /usr/lib/ssl/certs and c_rehash
scrooloose has quit [Quit: Connection closed for inactivity]
DTZUZO has joined #ruby
<darix> seems I have another action items NOTE: Gem::Specification#has_rdoc is deprecated with no replacement. It will be removed on or after 2018-12-01.
Dbugger has joined #ruby
* havenwood looks at the calendar
<darix> /etc/ssl/certs/ca-certificates.crt this seems like something wrong when you use update-ca-certificates
<darix> havenwood: before I can work on this I need to wait for my gitlab package to publish
<isene> That ENV['SSL_CERT_FILE'] = '/etc/ssl/certs/ca-certificates.crt' did nothing. I will try to copy the .crt file to .pem and do c_rehash
<darix> you shouldnt have to use c_rehash anymore with a system that uses update-ca-certificates
<darix> i have the feeling you are mixing a lot of things there
kapil____ has quit [Quit: Connection closed for inactivity]
<isene> darix: Well, I have tried what seems to be everything under the sun here and still coming up short :-/
<darix> isene: normally if you use your system ruby and dont configure anything special with your CA certs in your script or any of the gems you are using
<darix> than ruby (well openssl) should find the system certs automatically
<darix> easiest way to test that is
<darix> openssl s_client -connect someservice:someport < /dev/null
<isene> darix: I have done that. Works just fine. Python also works just fine. But Ruby goes haywire (see https://isene.org/x/strace.log3)
spacesui_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<darix> how did you install that ruby?
<isene> So - it isn't a certificate issue, it is a ruby issue. I do this: ruby -r net/imap -e 'p Net::IMAP.new("imap.gmail.com", 993, ssl: true)' and it reports this: /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate) (OpenSSL::SSL::SSLError)
<darix> looks like debian or so
spacesuitdiver has joined #ruby
<darix> works fine with ruby 2.5 on opensuse :P
venmx has joined #ruby
<isene> Everything worked just fine up until I upgraded from Ubuntu 18.04 to 18.10 yesterday (I mean it has worked more than 5 million times over the past 10 years with script running every minute)
postmodern has joined #ruby
spacesuitdiver has quit [Client Quit]
code_zombie has joined #ruby
<darix> did you check their bugtracker if it is a known issue?
spacesuitdiver has joined #ruby
spacesuitdiver has quit [Client Quit]
<isene> didn't find anything
<isene> I even tried to purge and reinstall all of ruby but with no change
<darix> poking a friend at ubuntu
<darix> if he can reproduce it
<isene> please do, I'm flustered like whack
cow[away] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has quit [Ping timeout: 250 seconds]
cow[moo] has joined #ruby
brendan- has quit [Quit: Textual IRC Client: www.textualapp.com]
connermcd has joined #ruby
<isene> running the connection to imap.gmail.com in irb, I get this:
<isene> OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate)
<isene> from /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock'
<darix> isene: he can reproduce it
<isene> Woooha!
<darix> isene: my friend ask if you can file a bug
<isene> A fellow flusterado
<isene> Where and how do I file a bug?
<darix> launchpad i guess
druonysus has quit [Ping timeout: 244 seconds]
Guest27748 has quit [Quit: WeeChat 2.3]
deathwishdave has joined #ruby
al2o3-cr has joined #ruby
deathwishdave has quit [Client Quit]
holdenjd has quit [Quit: Page closed]
sarink has joined #ruby
DTZUZO has joined #ruby
deathwishdave has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
deathwishdave has quit [Client Quit]
elphe has joined #ruby
mostlybadfly has joined #ruby
<isene> Looks OK according to your friend?
elphe has quit [Ping timeout: 250 seconds]
spacesuitdiver has joined #ruby
neuraload has quit [Quit: This computer has gone to sleep]
ober has joined #ruby
ByronJohnson has quit [Ping timeout: 245 seconds]
sonofentropy has joined #ruby
dbz has joined #ruby
donofrio has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
conta has quit [Quit: conta]
<darix> isene: looks good
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
donofrio has quit [Ping timeout: 268 seconds]
twobitsprite has quit [Ping timeout: 245 seconds]
dbz has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
twobitsprite has joined #ruby
elphe has joined #ruby
Fusl has quit [Excess Flood]
tjarvis has quit [Quit: WeeChat 2.3]
donofrio has joined #ruby
Fusl has joined #ruby
ixti has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
twobitsprite has quit [Ping timeout: 250 seconds]
m0w has quit [Ping timeout: 250 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
connermcd has quit [Quit: WeeChat 2.3]
donofrio has quit [Ping timeout: 268 seconds]
druonysus has joined #ruby
ober has left #ruby ["ERC (IRC client for Emacs 26.1)"]
<quintasan> Is anyone familiar with BigInteger internals? I'm trying to find how does MRI handle cases when a custom class implements #coerce
ua has quit [Ping timeout: 250 seconds]
cnsvc_ has quit [Ping timeout: 256 seconds]
lytol has joined #ruby
donofrio has joined #ruby
hutch has quit [Ping timeout: 240 seconds]
ua has joined #ruby
connermcd has joined #ruby
Dbugger has quit [Remote host closed the connection]
sarink has quit [Remote host closed the connection]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
cnsvc_ has joined #ruby
sagax has joined #ruby
<sagax> hi all!
<sagax> what i can read about `` ?
<sagax> `` it's for execute command of system shell
<isene> On Ubuntu 18.10, there is only Ruby 2.5.1 What's the simplest way of installing Ruby 2.0 instead?
<sagax> no, no
<sagax> i want to know - how it's work
<sagax> not just some example
<Eiam> isene: chruby and ruby-install?
<Eiam> sagax: "click to toggle source"
<Eiam> in the docs.
<Eiam> it will literally show the implementation, not sure how much more direct how it works gets!
venmx has quit [Ping timeout: 244 seconds]
<sagax> thanks, Eiam
<sagax> it's possible to know - how ruby was compiled?
<sagax> what keys was used
<sagax> ?
mostlybadfly has quit [Quit: Connection closed for inactivity]
elphe has joined #ruby
connermcd has quit [Quit: WeeChat 2.3]
donofrio has quit [Ping timeout: 246 seconds]
donofrio has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
paraxial has joined #ruby
tiff has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
reber has quit [Remote host closed the connection]
Exuma has joined #ruby
ubuntuisloved has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
m0w has joined #ruby
elphe has joined #ruby
SCHAPiE has quit [Quit: ZNC - https://znc.in]
elphe has quit [Ping timeout: 245 seconds]