Ask A Question


You’re not receiving notifications from this thread.

When installing Rails 6 on Ubuntu 20.04 I get an error with the Nokogiri gem

William Jones asked in Rails

I have been following the instructions at I get the following error,

Installing nokogiri 1.10.9 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.7.0/gems/nokogiri-1.10.9/ext/nokogiri

/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20200522-63887-8bdogk.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.

The rails version installed is, the ruby version is 2.7 and the Ubuntu version is 20.04 LTS. I am confused about the rails version because I used the 'gem install rails -v' command.

Any advice about how to proceed would be welcome.


I had problems because I didn't follow the instructions exactly. Everything works now.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,969+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.