Last Updated: February 25, 2016
·
800
· mauromorales

Fix issue when trying to install ruby 2.2.1 on openSUSE Leap

If you are installing ruby 2.2.1 in openSUSE but get an error like the one bellow. All you need to do is install the package libffi-devel-gcc5 and you should be good to go.

error:

$ rbenv install 2.2.1
Downloading ruby-2.2.1.tar.gz... -> https://dqw8nmjcqpjn7.cloudfront.net/5a4de38068eca8919cb087d338c0c2e3d72c9382c804fb27ab746e6c7819ab28
Installing ruby-2.2.1...

BUILD FAILED (SUSE LINUX 42.1 using ruby-build 20151028-4-gf71dbc9)

Inspect or clean up the working tree at /tmp/ruby-build.20151109133848.4063
Results logged to /tmp/ruby-build.20151109133848.4063.log

Last 10 log lines:
compiling ossl_rand.c
installing default openssl libraries
installing default psych libraries
linking shared-object psych.so
linking shared-object openssl.so
make[2]: Leaving directory '/tmp/ruby-build.20151109133848.4063/ruby-2.2.1/ext/psych'
make[2]: Leaving directory '/tmp/ruby-build.20151109133848.4063/ruby-2.2.1/ext/openssl'
make[1]: Leaving directory '/tmp/ruby-build.20151109133848.4063/ruby-2.2.1'
uncommon.mk:189: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2

solution:

zypper in libffi-devel-gcc5