Closed endgame closed 9 years ago
Please install libffi-dev via apt-get or use '--enabled-shared' option
Thank you, this fixes it for me.
Same issue with Debian 7 ; libffi-dev
was missing.
I added this issue into FAQ: https://github.com/sstephenson/ruby-build/wiki#build-failure-of-fiddle-with-ruby-220
@hsbt Can you add these packages to "suggested build environment" on the top? That would help people who paste these instructions prior to installing Ruby versions on their respective systems.
@mislav done! Thanks for your advice.
Hi, I'm using Debian jessie. I cannot find this package :
sudo apt-get install libffi-dev E: Package 'libffi-dev' has no installation candidate
sudo apt-get update; apt-cache search libffi libffi6 - Bibliothèque d'exécution de l'interface de fonction étrangère (FFI)
with Debian Wheezy (in an other server), I get more, do you know why? My source.list seems well configured.. sudo apt-get update; apt-cache search libffi ffindex-dbg - simple index/database for huge amounts of small files (debug) libffindex0 - library for simple index/database for huge amounts of small files libffindex0-dev - library for simple index/database for huge amounts of small files (development) libjffi-java - Java Foreign Function Interface libjffi-jni - Java Foreign Function Interface (JNI library) lib32ffi-dev - Foreign Function Interface library (development files, 32bit) libffi-dev - Foreign Function Interface library (development files) libffi5-dbg - Foreign Function Interface library runtime (debug symbols) libffi-ruby - Transitional package for ruby-ffi libffi-ruby1.8 - Transitional package for ruby-ffi libffi-ruby1.9.1 - Transitional package for ruby-ffi ruby-ffi - load dynamic libraries, bind functions from within ruby code libffi5 - Bibliothèque d'exécution de l'interface de fonction étrangère (FFI) libbfio-dbg - Library to provide basic input/output abstraction (debug)
Sorry, my /etc/apt/preferences was not empty
Same goes for CentOS 6.x where you'll need to yum install libffi-devel
sudo apt-get install libffi-dev
workd for me on Linux Mint 17.1. Thanks!
I'm having this exact issue on Ubuntu 14.04.1 LTS but I have libffi-dev
installed. Posted as a question on Stack Oveflow in case anyone has any insight.
same here with 14.04.1 LTS. I have the libffi-dev.
sovled after installed libffi-dev, thanks
Have same issue on Ubuntu 15.04 Alpha
$ RUBY_CONFIGURE_OPTS=--enable-shared rbenv install 2.2.0
Downloading ruby-2.2.0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...
BUILD FAILED (Ubuntu 15.04 using ruby-build 20150116-6-g7f1d8df)
Inspect or clean up the working tree at /tmp/ruby-build.20150122215659.9399
Results logged to /tmp/ruby-build.20150122215659.9399.log
Last 10 log lines:
from /tmp/ruby-build.20150122215659.9399/ruby-2.2.0/lib/rubygems.rb:556:in `install'
from ./tool/rbinstall.rb:717:in `block (2 levels) in <main>'
from ./tool/rbinstall.rb:716:in `each'
from ./tool/rbinstall.rb:716:in `block in <main>'
from ./tool/rbinstall.rb:749:in `call'
from ./tool/rbinstall.rb:749:in `block in <main>'
from ./tool/rbinstall.rb:746:in `each'
from ./tool/rbinstall.rb:746:in `<main>'
uncommon.mk:244: recipe for target 'do-install-all' failed
make: *** [do-install-all] Error 1
I am on 14.04.1 LTS and successfully installed 2.2 with rbenv install 2.2.0
after first running sudo apt-get install libffi-dev
A guy on my SO issue said that he fixed it by setting CFLAG
to CFLAG=-fPIC
.
I also had the same issue with 14.04. LTS. Solved after installing libffi-dev.
@ryanburnette We(ruby-core) added -fPIC option for next release of Ruby 2.2 :bow:
:+1:
👏
I had same problem, install libffi did not work but after I installed gcc using linuxbrew the ruby 2.2.0 installed successfully but installing gcc took 70 minutes on my VM.
installing sudo apt-get install libffi-dev
worked for me!
We released Ruby 2.2.1 with fixing bundled ffi problem. Please try it.
I have same issue with Ruby 2.2.1 on FreeBSD 9.3-STABLE amd64
I was able to fix it using:
- /etc/make.conf
CC=clang
CXX=clang++
CPP=clang-cpp
CFLAG=-fPIC
- export
$ CFLAG=-fPIC
$ export CFLAG
$ RUBY_CONFIGURE_OPTS=--enable-shared
$ export RUBY_CONFIGURE_OPTS
Then build:
$ rbenv install 2.2.1
Downloading ruby-2.2.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5a4de38068eca8919cb087d338c0c2e3d72c9382c804fb27ab746e6c7819ab28
Installing ruby-2.2.1...
Installed ruby-2.2.1 to /home/dev/.rbenv/versions/2.2.1
@naskoblg We already fixed FreeBSD issue with upstream. see https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/49957
@hsbt, so from what I've gathered, I do not have to manually install libffi-dev
anymore with 2.2.1, right? Because I tried with 2.2.1 and still get the following when not installing libffi-dev
linking shared-object fiddle.so
/usr/bin/ld: ./libffi-3.2.1/.libs/libffi.a(raw_api.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
./libffi-3.2.1/.libs/libffi.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-linux/fiddle.so] Error 1
make[2]: Leaving directory `/tmp/ruby-build.20150319171236.15537/ruby-2.2.1/ext/fiddle'
make[1]: *** [ext/fiddle/all] Error 2
The error message suggests, as @naskoblg already verified, that adding -fPIC
to the compiler flags works. I'll see how I can do that, since I'm using rbenv via chef on Ubuntu Server 14.04 LTS
Installing libffi-dev
fixed this for me. (Ruby 2.2.1, Ubuntu 14.04)
Installing libffi-dev
didn't help to install ruby 2.2.1
on my Debian 7. However installing with --enabled-shared
option activated helped. Thanks.
thanks, sudo apt-get install libffi-dev
helped on Ubuntu 14.04.1 LTS
to rbenv install 2.2.1
:heart_eyes:
on Amazon Linux 2014.09, same as @zachad for Centos, of course.
yum install libffi-devel
Hi all. Please try to Ruby 2.2.2
Hi all. Please try to Ruby 2.2.2
Works for me, thanks!
@aried3r :+1: Thanks for your feedback
After installing the libffi-devel-3.0.13-11.el7.x86_64
on Centos 7, it still fails to install Ruby 2.2.2...
Any idea?
UPDATE: installed after sudo -ing all the installation thing, but this is not good for long-term solution, right?
Having this issue with all 2.x. libffi-dev is installed.
$ RUBY_CONFIGURE_OPTS=--enable-shared
$ rbenv install 2.2.2
Downloading ruby-2.2.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz
error: failed to download ruby-2.2.2.tar.gz
BUILD FAILED (LinuxMint 17.2 using ruby-build 20150803)
After fiddling around a whole bunch, I found some errors in the logs related to certificates. This answer by Scott Emmons here (not the "correct" solution on that page but the second one down) fixed my problem.
Thank you, helped for Ubuntu 15.10 with Ruby 2.2.1.
installing sudo apt-get install libffi-dev worked for me on ubuntu 14.04.1. Thanks!
For AWS, after running yum install libffi-devel still issue occured, and need to execute yum install gcc and its fixed the issue.
ruby-build version:
20141225-1-g45b75ed
The acutal error is:
I've included the full build log below, please let me know if you need me to test anything or I can give you better information: