Ask A Question

Notifications

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 https://gorails.com/setup/ubuntu/20.04#ruby-rbenv. 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 6.0.3.1, 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 6.0.2.2' command.

Any advice about how to proceed would be welcome.

Reply

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

Reply
Join the discussion
Create an account Log in

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

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

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