Forum: Ruby Compiling Ruby on OSX, OpenSSL error and possible fix

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Juan M. (Guest)
on 2009-01-21 20:54
I got this error compiling Ruby (ruby-1.8.6-p287) on OSX (10.5.6, Darwin
Kernel Version 9.6.0):

openssl_missing.h:123: error: conflicting types for 'BN_rand_range'
/usr/local/include/openssl/bn.h:411: error: previous declaration of
'BN_rand_range' was here
openssl_missing.h:124: error: conflicting types for
'BN_pseudo_rand_range'
/usr/local/include/openssl/bn.h:412: error: previous declaration of
'BN_pseudo_rand_range' was here
make[1]: *** [openssl_missing.o] Error 1

These functions were declared in two different files. Once in
include/openssl/bn.h and again in
ruby-1.8.6-p287/ext/openssl/openssl_missing.h

I solved it commenting these two lines in include/openssl/bn.h[411,412].
Juan M. (Guest)
on 2009-01-21 21:34
Late, running Gem I got this error:

$ gem update
dyld: NSLinkModule() error
dyld: Symbol not found: _EVP_CIPHER_CTX_block_size
  Referenced from:
/usr/local/lib/ruby/1.8/i686-darwin9.6.0/openssl.bundle
  Expected in: flat namespace

Trace/BPT trap


Removing openssl port installed previously with macports all work fine!

You forgive for this monologue.
Juan M..

Juan M. wrote:
> I got this error compiling Ruby (ruby-1.8.6-p287) on OSX (10.5.6, Darwin
> Kernel Version 9.6.0):
>
> openssl_missing.h:123: error: conflicting types for 'BN_rand_range'
> /usr/local/include/openssl/bn.h:411: error: previous declaration of
> 'BN_rand_range' was here
> openssl_missing.h:124: error: conflicting types for
> 'BN_pseudo_rand_range'
> /usr/local/include/openssl/bn.h:412: error: previous declaration of
> 'BN_pseudo_rand_range' was here
> make[1]: *** [openssl_missing.o] Error 1
>
> These functions were declared in two different files. Once in
> include/openssl/bn.h and again in
> ruby-1.8.6-p287/ext/openssl/openssl_missing.h
>
> I solved it commenting these two lines in include/openssl/bn.h[411,412].
Brian H. (Guest)
on 2010-10-23 08:45
I got the same error installing Ruby EE 1.8.6 and solved it by moving
openssl out of my include path.

$ sudo mv /usr/include/openssl/ ~/

:)
This topic is locked and can not be replied to.