{"id":381,"date":"2014-06-26T03:25:02","date_gmt":"2014-06-26T03:25:02","guid":{"rendered":"https:\/\/digitalchild.info\/?p=381"},"modified":"2014-06-26T03:25:02","modified_gmt":"2014-06-26T03:25:02","slug":"gems-when-using-ruby-via-software-collections","status":"publish","type":"post","link":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/","title":{"rendered":"Gems when using Ruby via Software Collections"},"content":{"rendered":"

In my previous article<\/a> I outlined how to get Ruby installed via RedHat Software Collections (SCL) and this works for basic ruby commands until I tried to install my backup gem. I got an install error when trying to build the native extensions. This guide will show you how to install gems when using ruby via software collections.<\/p>\n

\n[root@machine1 ~]# gem install backup\nBuilding native extensions.\u00a0 This could take a while...\nERROR:\u00a0 Error installing backup:\nERROR: Failed to build gem native extension.\n\u00a0 \u00a0 \u00a0 \u00a0 \/opt\/rh\/ruby193\/root\/usr\/bin\/ruby extconf.rb\nmkmf.rb can't find header files for ruby at \/opt\/rh\/ruby193\/root\/usr\/share\/include\/ruby.h\nGem files will remain installed in \/opt\/rh\/ruby193\/root\/usr\/local\/share\/gems\/gems\/atomic-1.1.14 for inspection.\nResults logged to \/opt\/rh\/ruby193\/root\/usr\/local\/share\/gems\/gems\/atomic-1.1.14\/ext\/gem_make.out\n<\/pre>\n

I will need to install the relevant development tools to get this working. When installing ruby using other methods some how-to’s tell you to do the blanket install of all development tools. I want to make sure I run as lean an OS image as possible. So I will only install the required packages by running the following:<\/p>\n

\n\nsudo yum install gcc gcc-c++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel\u00a0ruby193-ruby-doc ruby193-ruby-devel ruby193-build\n<\/pre>\n

I now have everything I need to get gem to build the native extensions. So I run the command to install backup again and everything succeeds.<\/p>\n

\n\ngem install backup\n\n<\/pre>\n

The only problem I\u00a0have now is that when I try to run backup I get the following:<\/p>\n

\n[root@machine1 ~]# backup\n-bash: backup: command not found\n<\/pre>\n

This is because the gem was\u00a0installed inside of the software collections path so we will need to add this path to our existing path.<\/p>\n

\n\necho "pathmunge \/opt\/rh\/ruby193\/root\/usr\/local\/bin" | sudo tee -a \/etc\/profile.d\/ruby193.sh\n\n<\/pre>\n

This is\u00a0the same for any gems you install that need building. Once you’ve done the above gem install somegem<\/strong>\u00a0commands will work.<\/p>\n","protected":false},"excerpt":{"rendered":"

In my previous article I outlined how to get Ruby installed via RedHat Software Collections (SCL) and this works for basic ruby commands until I tried to install my backup gem. I got an install error when trying to build the native extensions. This guide will show you how to …<\/p>\n

Gems when using Ruby via Software Collections<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[5,9],"tags":[34,77,91,113,167,184],"yoast_head":"\nGems when using Ruby via Software Collections<\/title>\n<meta name=\"description\" content=\"This is a quick guide on installing gems when using ruby via software collections.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gems when using Ruby via Software Collections\" \/>\n<meta property=\"og:description\" content=\"This is a quick guide on installing gems when using ruby via software collections.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/\" \/>\n<meta property=\"og:site_name\" content=\"Random Adult\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-26T03:25:02+00:00\" \/>\n<meta name=\"author\" content=\"digitalchild\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dcwhatwhat\" \/>\n<meta name=\"twitter:site\" content=\"@dcwhatwhat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"digitalchild\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/\"},\"author\":{\"name\":\"digitalchild\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04\"},\"headline\":\"Gems when using Ruby via Software Collections\",\"datePublished\":\"2014-06-26T03:25:02+00:00\",\"dateModified\":\"2014-06-26T03:25:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/\"},\"wordCount\":365,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/randomadult.local\/#organization\"},\"keywords\":[\"centos\",\"gems\",\"how to\",\"linux\",\"ruby\",\"software collections\"],\"articleSection\":[\"Geek\",\"Tip\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/\",\"url\":\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/\",\"name\":\"Gems when using Ruby via Software Collections\",\"isPartOf\":{\"@id\":\"https:\/\/randomadult.local\/#website\"},\"datePublished\":\"2014-06-26T03:25:02+00:00\",\"dateModified\":\"2014-06-26T03:25:02+00:00\",\"description\":\"This is a quick guide on installing gems when using ruby via software collections.\",\"breadcrumb\":{\"@id\":\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/randomadult.local\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Gems when using Ruby via Software Collections\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/randomadult.local\/#website\",\"url\":\"https:\/\/randomadult.local\/\",\"name\":\"Random Adult\",\"description\":\"Ramblings of a random adult\",\"publisher\":{\"@id\":\"https:\/\/randomadult.local\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/randomadult.local\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/randomadult.local\/#organization\",\"name\":\"Random Adult\",\"url\":\"https:\/\/randomadult.local\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png\",\"contentUrl\":\"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png\",\"width\":320,\"height\":134,\"caption\":\"Random Adult\"},\"image\":{\"@id\":\"https:\/\/randomadult.local\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/dcwhatwhat\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04\",\"name\":\"digitalchild\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g\",\"caption\":\"digitalchild\"},\"url\":\"https:\/\/randomadult.local\/author\/digitalchild\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Gems when using Ruby via Software Collections","description":"This is a quick guide on installing gems when using ruby via software collections.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/","og_locale":"en_US","og_type":"article","og_title":"Gems when using Ruby via Software Collections","og_description":"This is a quick guide on installing gems when using ruby via software collections.","og_url":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/","og_site_name":"Random Adult","article_published_time":"2014-06-26T03:25:02+00:00","author":"digitalchild","twitter_card":"summary_large_image","twitter_creator":"@dcwhatwhat","twitter_site":"@dcwhatwhat","twitter_misc":{"Written by":"digitalchild","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#article","isPartOf":{"@id":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/"},"author":{"name":"digitalchild","@id":"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04"},"headline":"Gems when using Ruby via Software Collections","datePublished":"2014-06-26T03:25:02+00:00","dateModified":"2014-06-26T03:25:02+00:00","mainEntityOfPage":{"@id":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/"},"wordCount":365,"commentCount":0,"publisher":{"@id":"https:\/\/randomadult.local\/#organization"},"keywords":["centos","gems","how to","linux","ruby","software collections"],"articleSection":["Geek","Tip"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/","url":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/","name":"Gems when using Ruby via Software Collections","isPartOf":{"@id":"https:\/\/randomadult.local\/#website"},"datePublished":"2014-06-26T03:25:02+00:00","dateModified":"2014-06-26T03:25:02+00:00","description":"This is a quick guide on installing gems when using ruby via software collections.","breadcrumb":{"@id":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/randomadult.local\/gems-when-using-ruby-via-software-collections\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/randomadult.local\/"},{"@type":"ListItem","position":2,"name":"Gems when using Ruby via Software Collections"}]},{"@type":"WebSite","@id":"https:\/\/randomadult.local\/#website","url":"https:\/\/randomadult.local\/","name":"Random Adult","description":"Ramblings of a random adult","publisher":{"@id":"https:\/\/randomadult.local\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/randomadult.local\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/randomadult.local\/#organization","name":"Random Adult","url":"https:\/\/randomadult.local\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/randomadult.local\/#\/schema\/logo\/image\/","url":"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png","contentUrl":"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png","width":320,"height":134,"caption":"Random Adult"},"image":{"@id":"https:\/\/randomadult.local\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/dcwhatwhat"]},{"@type":"Person","@id":"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04","name":"digitalchild","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/randomadult.local\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g","caption":"digitalchild"},"url":"https:\/\/randomadult.local\/author\/digitalchild\/"}]}},"_links":{"self":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts\/381"}],"collection":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/comments?post=381"}],"version-history":[{"count":0,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts\/381\/revisions"}],"wp:attachment":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/media?parent=381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/categories?post=381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/tags?post=381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}