{"id":45211,"date":"2024-01-16T10:52:06","date_gmt":"2024-01-16T10:52:06","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=45211"},"modified":"2024-12-25T12:03:48","modified_gmt":"2024-12-25T12:03:48","slug":"install-ruby-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2024\/01\/install-ruby-ubuntu-24-04\/","title":{"rendered":"How to Install Ruby in Ubuntu 24.04 LTS"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-45212\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-logo-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This is a step by step beginners guide shows how to install Ruby and setup local programming environment in Ubuntu 24.04 LTS.<\/p>\n<p>Ruby is an interpreted, high-level programming language designed with an emphasis on programming productivity and simplicity. It was first released 29 years ago in 1995, by Yukihiro Matsumoto in Japan.<\/p>\n<p>Ruby is available to install in Ubuntu in a few different ways, they include:<\/p>\n<ul>\n<li><b>Snap package<\/b>.<\/li>\n<li><b>Deb package<\/b> in system repository.<\/li>\n<li><b>Third-party manager<\/b> with multiple version support.<\/li>\n<li><b>Build from source<\/b>.<\/li>\n<\/ul>\n<p>And, here&#8217;s how to install them in Ubuntu step by step.<br \/>\n<!--more--><\/p>\n<h3>Method 1: Ruby Snap package<\/h3>\n<p>Snap package is always the easiest way to install and keep an app up-to-date in Ubuntu, however, it runs in sandbox.<\/p>\n<p>Ruby snap is available for <code>amd64<\/code> (modern Intel\/AMD), and <code>arm64\/armhf<\/code> (Apple Silicon and Raspberry Pi, etc) devices.<\/p>\n<p>For Ubuntu 24.04, simply <b>launch App Center, then search &amp; install ruby<\/b>.<\/p>\n<div id=\"attachment_45213\" style=\"width: 620px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-snap.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-45213\" class=\"size-large wp-image-45213\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-snap-700x477.webp\" alt=\"\" width=\"610\" height=\"416\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-snap-700x477.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-snap-300x204.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-snap-768x523.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-snap.webp 1025w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><p id=\"caption-attachment-45213\" class=\"wp-caption-text\">Ruby in App Center<\/p><\/div>\n<p>Or, press <code>Ctrl+Alt+T<\/code> on keyboard to open terminal, and run command to install it:<\/p>\n<pre>snap install ruby --classic<\/pre>\n<p>Once installed, run <code>ruby --version<\/code> to verify, and <code>ruby --help<\/code> to get help. Or, run <code>irb<\/code> to enter interactive session to play with it. For more, see the official <a href=\"https:\/\/www.ruby-lang.org\/en\/documentation\/quickstart\/\" target=\"_blank\" rel=\"noopener\">Quick Start<\/a> wiki.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-in-ubuntuterminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45215\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-in-ubuntuterminal-700x438.webp\" alt=\"\" width=\"610\" height=\"382\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-in-ubuntuterminal-700x438.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-in-ubuntuterminal-300x188.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-in-ubuntuterminal-768x480.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/ruby-in-ubuntuterminal.webp 1280w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>Uninstall Ruby Snap package<\/h4>\n<p>To remove the package, also use App Center or run command in terminal:<\/p>\n<pre>snap remove --purge ruby<\/pre>\n<h3>Method 2: Ruby in system repository<\/h3>\n<p>Ruby is also available Ubuntu system repository. Though, always old!<\/p>\n<p>If you&#8217;re OK with Ruby 3.1, simply press <code>Ctrl+Alt+T<\/code> on keyboard to open terminal, and run command to install it:<\/p>\n<pre>sudo apt install ruby-full<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-full.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45214\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-full-700x423.webp\" alt=\"\" width=\"610\" height=\"369\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-full-700x423.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-full-300x181.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-full-768x464.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-full.webp 873w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>(<b>Optional<\/b>) To uninstall, run command:<\/p>\n<pre>sudo apt remove --autoremove ruby ruby-full<\/pre>\n<h3>Method 3: Install Ruby via 3rd party package management system<\/h3>\n<p>If you want to work with multiple version of Ruby, then Ruby website refers to <b>rbenv<\/b> and <b>RVM<\/b> package manager.<\/p>\n<h4>Option 1: Install Ruby via rbenv<\/h4>\n<p><a href=\"https:\/\/github.com\/rbenv\/rbenv\" target=\"_blank\" rel=\"noopener\">rbenv<\/a> is a one of the most popular way to manage Ruby environment.<\/p>\n<p><b>1.<\/b> First, press <code>Ctrl+Alt+T<\/code> on keyboard to open terminal. Then, run command to install rbenv:<\/p>\n<pre>sudo apt install rbenv<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-rbenv.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45216\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-rbenv-700x492.webp\" alt=\"\" width=\"610\" height=\"429\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-rbenv-700x492.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-rbenv-300x211.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-rbenv-768x540.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-rbenv.webp 889w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><br \/>\n<b>2.<\/b> For being able to install the most recent Ruby packages, you have to upgrade the <code>ruby-build<\/code> plugin to the latest.<\/p>\n<ul>\n<li>First, run command in terminal to remove the old one:\n<pre>sudo apt remove ruby-build<\/pre>\n<\/li>\n<li>Then, run command to download the latest one by cloning from Github:\n<pre>git clone https:\/\/github.com\/rbenv\/ruby-build.git \"$(rbenv root)\"\/plugins\/ruby-build<\/pre>\n<p><i>Run <code>sudo apt install git<\/code> if the git command not found.<\/i><\/li>\n<li>Finally, upgrade the <code>ruby-build<\/code> plugin for rbenv:\n<pre>git -C \"$(rbenv root)\"\/plugins\/ruby-build pull<\/pre>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-build.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45221\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-build-700x386.webp\" alt=\"\" width=\"610\" height=\"336\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-build-700x386.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-build-300x165.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-build-768x423.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-build.webp 886w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><br \/>\n<b>3.<\/b> After installed <code>rbenv<\/code> and updated the <code>ruby-build<\/code> plugin, you may list all stable Ruby versions by running command:<\/p>\n<pre>rbenv install -l<\/pre>\n<p>Or, run <code>rbenv install -L<\/code> to list old and dev versions.<\/p>\n<p><b>4.<\/b> To install a Ruby version, 3.4.1 for example, simply run:<\/p>\n<pre>rbenv install 3.4.1<\/pre>\n<p>Then command will automatically download the source tarball, compile and install it into your system under <code>~\/.rbenv\/versions\/<\/code> directory.<\/p>\n<p>For choice, you may re-run the last command by replacing 3.4.1 with another version number to install multi-versions of Ruby lang in your system.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-341.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47813\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-341-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-341-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-341-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rbenv-ruby-341.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>5.<\/b> Finally, you may run <code>rbenv versions<\/code> to list all installed Ruby versions.<\/p>\n<p>And, to set Ruby environment for certain project folder, just run command:<\/p>\n<pre>cd myproject &amp;&amp; rbenv local 3.4.1<\/pre>\n<p>Or, set global Ruby version for the system via command:<\/p>\n<pre>rbenv global 3.4.1<\/pre>\n<p>For Ruby gems, run command to install it after setting Ruby version for your project:<\/p>\n<pre>gem install bundler<\/pre>\n<h4>Uninstall rbenv<\/h4>\n<p>To uninstall Ruby versions installed via rbenv, first list all installed:<\/p>\n<pre>rbenv versions<\/pre>\n<p>Then, uninstall a Ruby version (e.g., 3.4.1):<\/p>\n<pre>rbenv uninstall 3.4.1<\/pre>\n<p>To remove rbenv package itself, run command:<\/p>\n<pre>sudo apt remove --autoremove rbenv<\/pre>\n<h4>Option 2: Install Ruby via RVM<\/h4>\n<p>RVM is another popular way to install and setup Ruby environment between multiple versions. However, it&#8217;s not available in Ubuntu system repository.<\/p>\n<p>1. To install <a href=\"https:\/\/github.com\/rvm\/rvm\/\" target=\"_blank\" rel=\"noopener\">RVM<\/a>, you need to first open terminal (Ctrl+Alt+T) and run commands:<\/p>\n<ul>\n<li>First, run command to grab the key:\n<pre>gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB<\/pre>\n<\/li>\n<li>Then, download the official script and run to install RVM:\n<pre>\\curl -sSL https:\/\/get.rvm.io | bash -s master<\/pre>\n<p><i>Run <code>sudo apt install curl<\/code> to install curl if command not found. And, run <code>rvm get master<\/code> for updating rvm package<\/i><\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/install-rvm.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45217\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/install-rvm-700x532.webp\" alt=\"\" width=\"610\" height=\"464\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/install-rvm-700x532.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/install-rvm-300x228.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/install-rvm-768x584.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/install-rvm.webp 915w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>2. After installed RVM, you need to <b>log out and back in<\/b> to apply the PATH variable for it.<\/p>\n<p>Then, run command to list all available Ruby versions:<\/p>\n<pre>rvm list known<\/pre>\n<p>And, install one Ruby version, 3.3.0 for example, by running command:<\/p>\n<pre>rvm install ruby-3.3.0<\/pre>\n<p>Or skip the INTERPRETER, and use <code>rvm install 3.3.0<\/code> instead. It will first try to find the package from system repository, if not found, then download &amp; build from\u00a0 the source automatically.<\/p>\n<p>Also, run <code>rvm install<\/code> multiple times if you want to install different versions.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rvm-install-ruby.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45218\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rvm-install-ruby-700x456.webp\" alt=\"\" width=\"610\" height=\"397\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rvm-install-ruby-700x456.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rvm-install-ruby-300x195.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rvm-install-ruby-768x500.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/rvm-install-ruby.webp 1101w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>3. Finally, run <code>rvm list<\/code> to get a list of all installed Ruby versions.<\/p>\n<p>To set system default Ruby environment, run:<\/p>\n<pre>rvm 3.3.0 --default<\/pre>\n<p>Or, navigate to your project folder, and run command to set for current only:<\/p>\n<pre>rvm use ruby-3.3.0<\/pre>\n<p><b>NOTE:<\/b> You have to enable &#8220;<code>Run command as login shell<\/code>&#8221; option in terminal &#8216;Preferences&#8217; dialog (usually under Unnamed profile -&gt; Command tab). Or, it will output error &#8220;<i>RVM is not a function, selecting rubies with &#8216;rvm use &#8230;&#8217; will not work.<\/i>&#8221;<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/terminal-enable-login-shell.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45219\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/terminal-enable-login-shell-700x499.webp\" alt=\"\" width=\"610\" height=\"435\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/terminal-enable-login-shell-700x499.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/terminal-enable-login-shell-300x214.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/terminal-enable-login-shell-768x547.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/terminal-enable-login-shell.webp 922w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>Uninstall RVM<\/h4>\n<p>To remove Ruby via RVM, first list all installed via command:<\/p>\n<pre>rvm list<\/pre>\n<p>Then, remove one (3.3.0 for example) either with <code>remove<\/code> (also delete source) or <code>uninstall<\/code> option:<\/p>\n<pre>rvm uninstall 3.3.0<\/pre>\n<p>To remove rvm itself, just delete the installation folder by running command:<\/p>\n<pre>rm -R ~\/.rvm<\/pre>\n<p>Also, delete the GPG keys by running 2 commands below:<\/p>\n<pre>gpg --delete-keys Michal Papis<\/pre>\n<pre>gpg --delete-keys Piotr Kuczynski<\/pre>\n<h3>Method 4: Compile Ruby from source tarball<\/h3>\n<p>For choice, you may also build Ruby from the source tarball.<\/p>\n<p><b>1<\/b>. First, select download desired Ruby version from the link below:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/cache.ruby-lang.org\/pub\/ruby\/\" target=\"_blank\" rel=\"noreferrer noopener\">Download Ruby Source<\/a><\/div>\n<\/div>\n<p>Then, extract the downloaded source tarball, right-click on source folder and select &#8220;<b>Open in Terminal<\/b>&#8220;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/open-ruby341-terminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47814\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/open-ruby341-terminal-700x501.webp\" alt=\"\" width=\"610\" height=\"437\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/open-ruby341-terminal-700x501.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/open-ruby341-terminal-300x215.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/open-ruby341-terminal-768x550.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/open-ruby341-terminal.webp 944w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2<\/b>. In pop-up terminal window, first run command to install dependency libraries:<\/p>\n<pre>sudo apt install build-essential libyaml-dev openssl zlib1g-dev libffi-dev libgmp-dev rustc<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-deps.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45224\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-deps-700x418.png\" alt=\"\" width=\"610\" height=\"364\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-deps-700x418.png 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-deps-300x179.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-deps-768x459.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/apt-ruby-deps.png 920w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3<\/b>. Then, configure the source.<\/p>\n<p>If you want to configure it with all default options, just run:<\/p>\n<pre>.\/configure<\/pre>\n<p>Or, run <code>.\/configure --help<\/code> to list all available optional features. Then, run command below instead to enable\/disable some specific features.<\/p>\n<p>For example, set installation directory to user local folder with <code>--prefix=$HOME\/.local<\/code> (by default \/usr\/local), enable development build <code>--enable-devel<\/code>, disable PIE feature <code>--disable-pie<\/code> via command:<\/p>\n<pre>.\/configure --prefix=$HOME\/.local --enable-devel --disable-pie<\/pre>\n<p><i>Add or Remove configure options in the command as you prefer!<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/configure-ruby341.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47815\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/configure-ruby341-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/configure-ruby341-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/configure-ruby341-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/configure-ruby341.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>4<\/b>. If no error in last command output, then you can make &amp; install Ruby from source by running following 2 commands one by one:<\/p>\n<pre>make -j4<\/pre>\n<pre>sudo make install<\/pre>\n<p>Here, <code>-j4<\/code> start 4 threads in parallel to speed up the process. <code>sudo<\/code> is not required if you set <code>--prefer<\/code> to a sub-folder of $HOME.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/makeinstall-ruby341.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47816\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/makeinstall-ruby341-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/makeinstall-ruby341-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/makeinstall-ruby341-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/01\/makeinstall-ruby341.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>Uninstall Ruby build from source<\/h4>\n<p>Until you removed the source folder, you can easily uninstall Ruby, by running the command below after opening source folder in terminal:<\/p>\n<pre>sudo make uninstall<\/pre>\n<p>If you already removed the source folder, then you have to manually delete all the installed files.<\/p>\n<h3>Summary:<\/h3>\n<p>In this tutorial, I&#8217;ve shown you how to install and setup Ruby programming environment in Ubuntu 24.04 in few different ways.<\/p>\n<p>In general, <code>Snap<\/code> and <code>.deb<\/code> package in system repository is the most easy way to get it. However, 3rd party manager are good choice to manage multiple Ruby environments. For specific features, it&#8217;s also easy to build it from the source tarball.<\/p>","protected":false},"excerpt":{"rendered":"<p>This is a step by step beginners guide shows how to install Ruby and setup local programming environment in Ubuntu 24.04 LTS. Ruby is an interpreted, high-level programming language designed with an emphasis on programming productivity and simplicity. It was first released 29 years ago in 1995, by Yukihiro Matsumoto in Japan. Ruby is available [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":45212,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1600],"class_list":["post-45211","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-ruby"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=45211"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45211\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/45212"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=45211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=45211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=45211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}