0

I tried to install Ruby selenium-webdriver but I got this error:

sudo gem install selenium-webdriver
[sudo] password for sam: 
Building native extensions.  This could take a while...
ERROR:  Error installing selenium-webdriver:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby2.4 -r ./siteconf20170509-10458-cbn64m.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.4.0/gems/ffi-1.9.18 for inspection.
Results logged to /var/lib/gems/2.4.0/extensions/x86_64-linux/2.4.0/ffi-1.9.18/gem_make.out

I've tried different methods that I found from different forums but they didn't work for me.Ruby version is 2.4 and Ubuntu version is 16.04

5
  • You've tried different methods — but what were they? Commented May 9, 2017 at 1:04
  • I have tried: apt-get install ruby-dev , sudo gem update --system, sudo apt-get install make Commented May 9, 2017 at 1:30
  • That, as well as the contents of /var/lib/gems/2.4.0/extensions/x86_64-linux/2.4.0/ffi-1.9.18/gem_make.out, should be edited into the question Commented May 9, 2017 at 1:32
  • This one solved my problem: sudo apt-get install ruby2.4-dev Commented May 9, 2017 at 1:42
  • Interesting, considering that the unversioned -dev package didn't. Don't forget to post that as an answer! Commented May 9, 2017 at 1:45

1 Answer 1

0

I tried this and it solved my problem:

sudo apt-get install ruby2.4-dev

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.