When installing Rails 6 on Ubuntu 20.04 I get an error with the Nokogiri gem
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 18.104.22.168, 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 22.214.171.124' command.
Any advice about how to proceed would be welcome.
I had problems because I didn't follow the instructions exactly. Everything works now.