0

Following error occurred while trying to configure githubpage from my local machine:

Error Displayed:

An error occurred while installing ffi
(1.9.14), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.14'`
succeeds before bundling.


Running the command gem install ffi -v '1..9.14' following error occurred.

sudo  gem install ffi -v '1.9.14'
Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160930-6846-1an2in3.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.14 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/ffi-1.9.14/gem_make.out

Then I looked at the log file: gem_make.out which showed following error

sudo cat /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/ffi-    1.9.14/gem_make.out
current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160930-6846-1an2in3.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Either suggest me the way to download ruby.h and add it in that particular location or help me with the right way if installation of gem.

1

2 Answers 2

3

I have had the similar problem.

An error occurred while installing ffi (1.9.14), and Bundler cannot continue.

Make sure that gem install ffi -v '1.9.14' succeeds before bundling.

I fixed it with sudo apt-get install ruby-dev. I've found the answer here

0

Installing ruby-dev didn't solve this for me. This appears to be a known issue, see here.

The fix given there (which worked for me) is:

sudo apt install libffi-dev

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .