0

I have written a Ruby gem that makes use of the most recent version of FFI to access a (as well self written) shared object library. I am using ruby 2.0.0p247 in conjunction with rvm 1.21.12.

My gem includes an 'executable' in /bin thats works as expected, reads in some data given by the user, and calls one function in my shared object library that in turn calls one function in an external API library. Everything works fine.

If I execute the exact same code of my 'executable' inside an RSpec test, or inside a Rails console, the underlying API components fails. It seems to fail during a SSL operation where a RSA private key read from a PKCS#12 container is used to digitally sign a piece of XML.

I was able to break everything down to bundler. If I execute my (working) 'executable' using bundler, it fails with the same error that I see inside RSpec and Rails.

I crosschecked ENV variables already and set them directly at the execution time. No change.

So the question is: What does bundler do to the execution environment, that lets fail my underlying API component.

Where can I start to look for errors?

Any hints on that are welcome. Regards Felix

Rajarshi Das
  • 11,778
  • 6
  • 46
  • 74
GeorgieF
  • 2,687
  • 5
  • 29
  • 43
  • can you please show the errors? – Rajarshi Das Aug 01 '13 at 08:12
  • I only get an error message from the underlying C++ API component. It states: `error:06069097:digital envelope routines:EVP_PKEY_encrypt:operation not initialized` – GeorgieF Aug 01 '13 at 08:19
  • `bundle exec` does change some environment variables. You can see what's changed by running this command from your project directory: `diff -u <(env|sort) <(bundle exec env|sort)`. How are you setting the environment variables at execution time? Is it possible that your settings are getting overridden at a later point? – Tim Moore Aug 02 '13 at 23:02
  • I had the same suspicion. As it turned out, it was'nt a bundler issue. The real problem was related to the openssl version thats beeing installed by the latest Debian. Removing it and installing 0.9.8y from source solved the problem. – GeorgieF Aug 07 '13 at 12:22

0 Answers0