{"id":1283,"date":"2018-06-27T13:00:51","date_gmt":"2018-06-27T12:00:51","guid":{"rendered":"http:\/\/chewett.co.uk\/blog\/?p=1283"},"modified":"2018-06-28T21:26:26","modified_gmt":"2018-06-28T20:26:26","slug":"fixing-failed-to-build-nokogiri-1-8-3-gem-fedora-28","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/1283\/fixing-failed-to-build-nokogiri-1-8-3-gem-fedora-28\/","title":{"rendered":"Fixing Failed to build nokogiri 1.8.3 gem Fedora 28"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1300\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/1283\/fixing-failed-to-build-nokogiri-1-8-3-gem-fedora-28\/fixing_failed_to_build_nokogiri_fedora-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fixing_failed_to_build_nokogiri_fedora\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?fit=678%2C254&amp;ssl=1\" class=\"aligncenter size-full wp-image-1300\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?resize=678%2C254\" alt=\"\" width=\"678\" height=\"254\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora-1.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<p>Today I talk about how I fixed &#8220;Failed to build nokogiri\u00a01.8.3&#8221; on Fedora 28.<\/p>\n<p><!--more--><\/p>\n<h2>Whats the issue with nokogiri 1.8.3 on Fedora 28?<\/h2>\n<p>At the moment any ruby applications that requires nokogiri\u00a01.8.3 in the Gemfile will fail to build. This is due to an issue with the libraries packaged in Fedora.<\/p>\n<p>As far as I can tell from the bug reports, this is only present in Fedora due to how ruby and the dev files are packaged.<\/p>\n<p>Commonly this is shown up with a similar error to:<\/p>\n<pre>Gem::Ext::BuildError: ERROR: Failed to build gem native extension.\r\n\r\ncurrent directory: \/usr\/share\/gems\/gems\/nokogiri-1.8.3\/ext\/nokogiri\r\n\/usr\/bin\/ruby -r .\/siteconf20180624-5605-fp1465.rb extconf.rb\r\nmkmf.rb can't find header files for ruby at \/usr\/share\/include\/ruby.h\r\n\r\nextconf failed, exit code 1\r\n\r\nGem files will remain installed in \/usr\/share\/gems\/gems\/nokogiri-1.8.3 for\r\ninspection.\r\nResults logged to \/usr\/lib64\/gems\/ruby\/nokogiri-1.8.3\/gem_make.out\r\n\r\nAn error occurred while installing nokogiri (1.8.3), and Bundler cannot\r\ncontinue.\r\nMake sure that `gem install nokogiri -v '1.8.3' --source\r\n'https:\/\/rubygems.org\/'` succeeds before bundling.\r\n\r\nIn Gemfile:\r\nrails was resolved to 4.2.8, which depends on\r\nactionmailer was resolved to 4.2.8, which depends on\r\nactionpack was resolved to 4.2.8, which depends on\r\nactionview was resolved to 4.2.8, which depends on\r\nrails-dom-testing was resolved to 1.0.9, which depends on\r\nnokogiri<\/pre>\n<h2>Fixing this by changing the Gemfile requirements<\/h2>\n<p>I got this error because I was installing Redmine which required the\u00a0nokogiri version to be:<\/p>\n<pre>gem \"nokogiri\", (RUBY_VERSION &gt;= \"2.1\" ? \"~&gt; 1.8.1\" : \"~&gt; 1.6.8\"<\/pre>\n<p>This selected the 1.8.3 version of nokogiri which as above it is impossible to install currently.<\/p>\n<p>To resolve this I installed the nokogiri\u00a0in Fedora using the following command:<\/p>\n<pre>sudo dnf install rubygem-nokogiri<\/pre>\n<p>After installing I noted down which version it had installed by reading the install log (example below).<\/p>\n<pre>Installed:\r\nrubygem-nokogiri.x86_64 <strong>1.8.2<\/strong>-1.fc28<\/pre>\n<p>Once I had worked out that I have installed 1.8.2 I then went back into the gemfile. By modifying it to specify nokogiri should use 1.8.2 (the version I just installed) the install then worked fine. I changed the gemfile to say:<\/p>\n<pre>gem \"nokogiri\", \"1.8.2\"<\/pre>\n<p>After changing this I was able to install redmine\u00a0as expected using <code>bundler install<\/code>.<\/p>\n<p>It is hoped that the issue with this package will be resolved quickly and the Fedora project will update the version in dnf however until then this fix will resolve the issue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I talk about how I fixed &#8220;Failed to build nokogiri\u00a01.8.3&#8221; on Fedora 28.<\/p>\n","protected":false},"author":1,"featured_media":1299,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Today I talk about how I fixed \"Failed to install #nokogiri 1.8.3 gem\" on #Fedora 28","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[41,274,277,275,276],"class_list":["post-1283","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fixes","tag-fedora","tag-fedora-28","tag-nokogiri","tag-redmine","tag-ruby"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-kH","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1281,"url":"https:\/\/chewett.co.uk\/blog\/1281\/how-to-install-redmine-on-fedora-28\/","url_meta":{"origin":1283,"position":0},"title":"How to Install Redmine on Fedora 28","author":"Chewett","date":"July 4, 2018","format":false,"excerpt":"In this post I talk about the additional steps needed to install Redmine on Fedora 28. Pre-installation\u00a0steps required for Fedora 28 To install Redmine\u00a0on Fedora 28 you will need to install a number of packages first. These are required for the\u00a0ruby gem files to be compiled and installed. To quickly\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":183,"url":"https:\/\/chewett.co.uk\/blog\/183\/install-virtualbox-guest-additions-fedora-21-xfce\/","url_meta":{"origin":1283,"position":1},"title":"Install Virtualbox guest additions on Fedora 21 XFCE","author":"Chewett","date":"February 8, 2015","format":false,"excerpt":"Installing via the normal route didn't work and meant I couldn't easily resize the screen. Doing the below allowed me to use the resize easily. Install rpmfusion on fedora run `sudo yum install\u00a0akmod-VirtualBox\u00a0VirtualBox-guest` run `cd\u00a0\/usr\/src\/akmods` run `sudo rpm -ivh VirtualBox-*.rpm` Once this was installed, rebooting will give you access to\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":997,"url":"https:\/\/chewett.co.uk\/blog\/997\/installing-dropbox-fedora-27-xfce\/","url_meta":{"origin":1283,"position":2},"title":"Installing Dropbox on Fedora 27 XFCE","author":"Chewett","date":"February 7, 2018","format":false,"excerpt":"This blog post describes how you can install Dropbox on Fedora 27 XFCE. Installing pre-requisite packages Before we can install Dropbox we need to install a number of pre-requisite packages. The full command to install the required packages is: sudo\u00a0dnf\u00a0install\u00a0libgnome\u00a0nautilus-extensions python-gpgme The first two packages, libgnome\u00a0and\u00a0nautilus-extensions, are required by the\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1830,"url":"https:\/\/chewett.co.uk\/blog\/1830\/installing-linode-longview-on-fedora-28\/","url_meta":{"origin":1283,"position":3},"title":"Installing Linode Longview on Fedora 28","author":"Chewett","date":"December 29, 2018","format":false,"excerpt":"This post talks about how you can install Linode Longview on Fedora 28. Why doesn't the standard instructions work? It turns out that you cannot just install Linode Longview on Fedora 28 as it isn't a supported operating system. When running the automatic install script the following error will appear.\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/installing_linode_longview.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/installing_linode_longview.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/installing_linode_longview.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/installing_linode_longview.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":869,"url":"https:\/\/chewett.co.uk\/blog\/869\/disable-selinux-fedora-26\/","url_meta":{"origin":1283,"position":4},"title":"How to Disable SELinux on Fedora 26","author":"Chewett","date":"November 25, 2017","format":false,"excerpt":"This post describes what SELinux is and how you can disable it on Fedora 26 if you need to. What is SELinux? SELinux stands for Security Enhanced Linux and it is an additional layer of security on your computer. At a basic level, it runs in the kernel and acts\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/disable_selinux_fedora_26.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/disable_selinux_fedora_26.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/disable_selinux_fedora_26.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/disable_selinux_fedora_26.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":490,"url":"https:\/\/chewett.co.uk\/blog\/490\/setting-ssl-certbot-apache-fedora\/","url_meta":{"origin":1283,"position":5},"title":"Setting up SSL with certbot with Apache and Fedora","author":"Chewett","date":"August 16, 2017","format":false,"excerpt":"This post describes how to set \u00a0up a SSL certificate with Certbot on Apache and Fedora. The guide primarily follows the guide on the certbot website however adds some additional information for if auto configuration fails. Running Certbot on Fedora On Fedora running certbot is relatively easy as it is\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=1283"}],"version-history":[{"count":6,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1283\/revisions"}],"predecessor-version":[{"id":1303,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1283\/revisions\/1303"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/1299"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=1283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=1283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=1283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}