{"id":8156,"date":"2021-08-17T01:02:04","date_gmt":"2021-08-17T01:02:04","guid":{"rendered":"https:\/\/green.cloud\/docs\/docly-documentation\/content\/configure-ruby-on-centos-linux\/"},"modified":"2026-01-19T00:45:43","modified_gmt":"2026-01-19T00:45:43","slug":"configure-ruby-on-centos-linux","status":"publish","type":"docs","link":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/","title":{"rendered":"Configure Ruby on CentOS Linux"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"8156\" class=\"elementor elementor-8156\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ba75ac7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ba75ac7\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1b079e2\" data-id=\"1b079e2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b1710c8 elementor-widget elementor-widget-text-editor\" data-id=\"b1710c8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div><span data-mention=\"Ruby is a great language for both web development and Linux Administration. Ruby provides many benefits found in all the previous languages discussed: PHP, Python, and Perl.\">Ruby is a great language for both web development and Linux Administration. Ruby provides many benefits found in all the previous languages discussed: PHP, Python, and Perl.<\/span><\/div>\n<div>&nbsp;<\/div>\n<div><span data-mention=\"To install Ruby, it is best to bootstrap through the rbenv which allows the administrators to easily install and manage Ruby Environments.\">To install Ruby, it is best to bootstrap through the rbenv which allows the administrators to easily install and manage Ruby Environments.<\/span><\/div>\n<div>&nbsp;<\/div>\n<div><span data-mention=\"The other method for installing Ruby is the standard CentOS packages for Ruby. It is advisable to use the rbenv method with all its benefits. CentOS packages will be easier for the non-Ruby savvy.\">The other method for installing Ruby is the standard CentOS packages for Ruby. It is advisable to use the rbenv method with all its benefits. CentOS packages will be easier for the non-Ruby savvy.<\/span><\/div>\n<div>&nbsp;<\/div>\n<div><span data-mention=\"First, let's get some needed dependencies for rbenv installer.\">First, let&#8217;s get some needed dependencies for rbenv installer.<\/span><\/div>\n<div>\n<ul>\n<li>git-core<\/li><li>zlib<\/li><li>zlib-devel<\/li><li>gcc-c++<\/li><li>patch<\/li><li>readline<\/li><li>readline-devel<\/li><li>libyaml-devel<\/li><li>libffi-devel<\/li><li>openssl-devel<\/li><li>make<\/li><li>bzzip2<\/li><li>autoconf<\/li><li>automake<\/li><li>libtool<\/li><li>bison<\/li><li>curl<\/li><li>sqlite-devel<\/li><\/ul><div>Most of these packages may already be installed depending on the chosen options and roles when installing CentOS. It is good to install everything we are unsure about as this can lead to less headache when installing packages requiring dependencies.<br><\/div>\n<pre><span data-mention=\"[root@CentOS]# yum -y install git-core zlib zlib-devel gcc-c++ patch readline \">[root@CentOS]# yum -y install git-core zlib zlib-devel gcc-c++ patch readline&nbsp;<\/span>readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel<\/pre>\n<\/div>\n<h2>Method 1 \u2212 rbenv for Dynamic Ruby Development Environments<\/h2>\n<div>&nbsp;<\/div>\n<p>Now as the user who will be using Ruby \u2212<\/p>\n<pre>[rdc@CentOS ~]$ git clone https:\/\/github.com\/rbenv\/rbenv.git<br>[rdc@CentOS ~]$ https:\/\/github.com\/rbenv\/ruby-build.git ruby-build will provide installation features to rbenv \u2212<\/pre>\n<p><b>Note <\/b>\u2212 We need to switch to root or an administration user before running install.sh<\/p>\n<pre>[rdc@CentOS ruby-build]$ cd ~\/ruby-build<br>[rdc@CentOS ruby-build]# .\/install.sh<\/pre>\n<p>Let&#8217;s set our shell for rbenv and assure we have installedthe correct options.<\/p>\n<pre>[rdc@CentOS ~]$ source ~\/rbenv\/rbenv.d\/exec\/gem-rehash.bash<br>[rdc@CentOS ruby-build]$ ~\/rbenv\/bin\/rbenv <br>rbenv 1.1.0-2-g4f8925a <br>Usage: rbenv <command><\/command> []<\/pre>\n<p>Some useful rbenv commands are \u2212<\/p>\n<table>\n<tbody>\n<tr>\n<th>Commands<\/th>\n<th>Action<\/th>\n<\/tr>\n<tr>\n<td>local<\/td>\n<td>Sets or shows the local application-specific Ruby version<\/td>\n<\/tr>\n<tr>\n<td>global<\/td>\n<td>Sets or shows the global Ruby version<\/td>\n<\/tr>\n<tr>\n<td>shell<\/td>\n<td>Sets or shows the shell-specific Ruby version<\/td>\n<\/tr>\n<tr>\n<td>install<\/td>\n<td>Installs a Ruby version using ruby-build<\/td>\n<\/tr>\n<tr>\n<td>uninstall<\/td>\n<td>Uninstalls a specific Ruby version<\/td>\n<\/tr>\n<tr>\n<td>rehash<\/td>\n<td>Rehashes rbenv shims (run this after installing executables)<\/td>\n<\/tr>\n<tr>\n<td>version<\/td>\n<td>Shows the current Ruby version and its origin<\/td>\n<\/tr>\n<tr>\n<td>versions<\/td>\n<td>Lists all Ruby versions available to rbenv<\/td>\n<\/tr>\n<tr>\n<td>which<\/td>\n<td>Displays the full path to an executable<\/td>\n<\/tr>\n<tr>\n<td>whence<\/td>\n<td>Lists all Ruby versions that contain the given executable<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><span data-mention=\"Let's now install Ruby \u2212\">Let&#8217;s now install Ruby \u2212<\/span><\/div>\n<div>&nbsp;<\/div>\n<pre><span data-mention=\"[rdc@CentOS bin]$ ~\/rbenv\/bin\/rbenv install -v 2.2.1\">[rdc@CentOS bin]$ ~\/rbenv\/bin\/rbenv install -v 2.2.1<\/span><\/pre>\n<div><span data-mention=\"After compilation completes \u2212\">After compilation completes \u2212<\/span><\/div>\n<div>&nbsp;<\/div>\n<pre><span data-mention=\"[rdc@CentOS ~]$ .\/ruby -v \">[rdc@CentOS ~]$ .\/ruby -v <br><\/span><span data-mention=\"ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] \">ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] <\/span><\/pre>\n<div>&nbsp;<\/div>\n<div><span data-mention=\"We now have a working Ruby environment with an updated and working version of Ruby 2.X branch.\">We now have a working Ruby environment with an updated and working version of Ruby 2.X branch.<\/span><\/div>\n<div>\n<h2 style=\"padding-top: 5px;\"><span style=\"white-space: pre-wrap;\" data-mention=\"Method 2 \u2212 Install Ruby from CentOS Packages\">Method 2 \u2212 Install Ruby from CentOS Packages<\/span><\/h2>\n<div>&nbsp;This is the most simple method. However, it can be limited by the version and gems packaged from CentOS. For serious development work, it is highly recommended to use the rbenv method to install Ruby.<\/div>\n<div>&nbsp;<\/div>\n<div>Install Ruby, needed development packages, and some common gems.<\/div>\n<div>&nbsp;<\/div>\n<pre>[root@CentOS rdc]# yum install -y ruby.x86_64 ruby-devel.x86_64 ruby-<br>libs.x86_64 ruby-gem-json.x86_64 rubygem-rake.noarch<\/pre>\n<div>Unfortunately, we are left with somewhat outdated version of Ruby.<\/div>\n<div>&nbsp;<\/div>\n<pre>[root@CentOS rdc]# ruby -v&nbsp;<br>ruby 2.0.0p648 (2015-12-16) [x86_64-linux]<\/pre>\n<div>&nbsp;<\/div>\n<\/div>\n<div><span data-mention=\"We now have a working Ruby environment with an updated and working version of Ruby 2.X branch.\">&nbsp;<\/span><\/div>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-acf6a72 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"acf6a72\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1b3c17c\" data-id=\"1b3c17c\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-124281b elementor-widget elementor-widget-image\" data-id=\"124281b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/green.cloud\/1ntr\">\n\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2021\/08\/2-2.png\" title=\"\" alt=\"\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Ruby is a great language for both web development and Linux Administration. Ruby provides many benefits found in all the previous languages discussed: PHP, Python, and Perl. &nbsp; To install Ruby, it is best to bootstrap through the rbenv which allows the administrators to easily install and manage Ruby Environments. &nbsp; The other method for [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"parent":17817,"menu_order":249,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-8156","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Configure Ruby on CentOS Linux - GreenCloud Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Configure Ruby on CentOS Linux - GreenCloud Documentation\" \/>\n<meta property=\"og:description\" content=\"Ruby is a great language for both web development and Linux Administration. Ruby provides many benefits found in all the previous languages discussed: PHP, Python, and Perl. &nbsp; To install Ruby, it is best to bootstrap through the rbenv which allows the administrators to easily install and manage Ruby Environments. &nbsp; The other method for [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"GreenCloud Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-19T00:45:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2021\/08\/2-2.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/\",\"name\":\"Configure Ruby on CentOS Linux - GreenCloud Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/2-2.png\",\"datePublished\":\"2021-08-17T01:02:04+00:00\",\"dateModified\":\"2026-01-19T00:45:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/2-2.png\",\"contentUrl\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/2-2.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/configure-ruby-on-centos-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GreenCloud Documents\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/docs\\\/greencloud-documents\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Linux Operating Systems\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/linux-operating-systems\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Configure Ruby on CentOS Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/#website\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/\",\"name\":\"GreenCloud Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/green.cloud\\\/docs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configure Ruby on CentOS Linux - GreenCloud Documentation","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:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/","og_locale":"en_US","og_type":"article","og_title":"Configure Ruby on CentOS Linux - GreenCloud Documentation","og_description":"Ruby is a great language for both web development and Linux Administration. Ruby provides many benefits found in all the previous languages discussed: PHP, Python, and Perl. &nbsp; To install Ruby, it is best to bootstrap through the rbenv which allows the administrators to easily install and manage Ruby Environments. &nbsp; The other method for [&hellip;]","og_url":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/","og_site_name":"GreenCloud Documentation","article_modified_time":"2026-01-19T00:45:43+00:00","og_image":[{"url":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2021\/08\/2-2.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/","url":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/","name":"Configure Ruby on CentOS Linux - GreenCloud Documentation","isPartOf":{"@id":"https:\/\/green.cloud\/docs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/#primaryimage"},"image":{"@id":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2021\/08\/2-2.png","datePublished":"2021-08-17T01:02:04+00:00","dateModified":"2026-01-19T00:45:43+00:00","breadcrumb":{"@id":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/#primaryimage","url":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2021\/08\/2-2.png","contentUrl":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2021\/08\/2-2.png"},{"@type":"BreadcrumbList","@id":"https:\/\/green.cloud\/docs\/configure-ruby-on-centos-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/green.cloud\/docs\/"},{"@type":"ListItem","position":2,"name":"GreenCloud Documents","item":"https:\/\/green.cloud\/docs\/docs\/greencloud-documents\/"},{"@type":"ListItem","position":3,"name":"Linux Operating Systems","item":"https:\/\/green.cloud\/docs\/linux-operating-systems\/"},{"@type":"ListItem","position":4,"name":"Configure Ruby on CentOS Linux"}]},{"@type":"WebSite","@id":"https:\/\/green.cloud\/docs\/#website","url":"https:\/\/green.cloud\/docs\/","name":"GreenCloud Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/green.cloud\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/8156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/comments?post=8156"}],"version-history":[{"count":1,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/8156\/revisions"}],"predecessor-version":[{"id":18303,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/8156\/revisions\/18303"}],"up":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/17817"}],"wp:attachment":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/media?parent=8156"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/doc_tag?post=8156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}