This weekend I was aiming to get the ruby voting discord bot running on the raspberry pi (so it could do something other than sit there). Yes, not super-productionized, but will suit its purpose. Anyway, I can spin it up on cloud hosting if need be.
I followed roughly the same steps as I documented here, and I do have my versions of the files on github, though they aren't in a cleaned up state for general use.
This time I got the following error:
undefined method `regenerate_key` for Bitcoin::OpenSSL_EC:Module
It seems also to be reported here, as well as some older posts on Steemit, but without resolution. So that didn't look so good. But after toying around a bit, I was able to get past it. The weird thing is that I didn't understand why what I did fixed the problem! Anyway, here's what did it for me:
I went into where the bitcoin-ruby gem was installed, which for me was
/var/lib/gems/2.3.0/gems/bitcoin-ruby-0.0.19/lib/bitcoin/ffi/openssl.rb
In this line in the ruby bitcoin module that was giving complaints, I changed it from
def self.regenerate_key(private_key)
to
def OpenSSL_EC.regenerate_key(private_key)
For some really bizarre reason, on the raspberry pi, prior to this change it wouldn't recognize regenerate_key, and when I debugged by dumping the methods, none of the methods were showing up. After this single change it suddenly worked... and I have no idea why. I didn't have to change any other methods... Ruby experts, any idea? ( maybe?)
In any case, I'm not going to worry too much about it. I have a working bot that's at the mercy of my home internet and not being accidentally being unplugged by Opal... (no just kidding, there's no chance of that, but someone else...)
Anyway, I just wanted to document how I got it working. Maybe there's something more obvious I could have been doing. If you happen to want to run that particular flavor of bot on your raspberry pi, well there you go (probably too late for someone that was asking roughly 1 year ago).
This is for the bot that is powering manual curation right now. Issuing lots and lots of cake. Like seen in https://steemit.com/@helpiecake/comments. Maybe more bells and whistles soon. We'll see!
Addendum
I did one other thing that I wasn't sure if it actually did anything, because it was not the initial error, and I possibly needed both actions, so I'll include this here as well. When debugging I ran the bot a slightly different way, and ran into the error documented in this issue
FFI::NotFoundError: Function 'SSL_library_init' not found in [libssl.so]
This I resolved by installing libssl v1.0.0 as documented here. Though the link there doesn't work for the package, and I used this one instead.