\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>\nI 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>\nI 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>\nThe 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>\nThis 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>\nThis 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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n