{"id":14099,"date":"2024-06-13T14:13:34","date_gmt":"2024-06-13T11:13:34","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=14099"},"modified":"2024-06-13T15:54:56","modified_gmt":"2024-06-13T12:54:56","slug":"how-to-install-ruby-on-rails-on-rocky-linux-8-10-systems","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-ruby-on-rails-on-rocky-linux-8-10-systems\/","title":{"rendered":"How to Install Ruby On Rails on Rocky Linux 8.10 Systems"},"content":{"rendered":"\n
Ruby on Rails, often simply called Rails, is a powerful web application framework written in Ruby. It follows the model-view-controller (MVC) architecture and emphasizes convention over configuration. This guide will walk you through the steps to install Ruby on Rails on a Rocky Linux 8.10 system.<\/p>\n\n\n\n
Before starting, ensure you have:<\/p>\n\n\n\n
Start by updating your system to ensure all existing packages are up to date.<\/p>\n\n\n\n
$ sudo dnf update -y<\/code><\/pre>\n\n\n\nStep 2: Install Dependencies<\/h3>\n\n\n\n
Install essential development tools and libraries required for building Ruby and other dependencies:<\/p>\n\n\n\n
$ sudo dnf groupinstall -y "Development Tools"\n$ sudo dnf install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison sqlite-devel<\/code><\/pre>\n\n\n\nStep 3: Install RVM (Ruby Version Manager)<\/h3>\n\n\n\n
RVM is a command-line tool which allows you to easily install, manage, and work with multiple Ruby environments.<\/p>\n\n\n\n
Add the GPG Key<\/h4>\n\n\n\n$ sudo dnf install -y gpg2\n$ gpg --keyserver hkp:\/\/keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3<\/code><\/pre>\n\n\n\nInstall RVM<\/h4>\n\n\n\n
Install RVM by running the following command:<\/p>\n\n\n\n
$ curl -sSL https:\/\/get.rvm.io | bash -s stable<\/code><\/pre>\n\n\n\nLoad RVM into your shell session:<\/p>\n\n\n\n
$ source ~\/.rvm\/scripts\/rvm<\/code><\/pre>\n\n\n\nStep 4: Install Ruby<\/h3>\n\n\n\n
With RVM installed, you can now install Ruby. For this guide, we\u2019ll install the latest stable version of Ruby.<\/p>\n\n\n\n
$ rvm install 3.1.2\n$ rvm use 3.1.2 --default<\/code><\/pre>\n\n\n\nVerify the Ruby installation:<\/p>\n\n\n\n
$ ruby -v<\/code><\/pre>\n\n\n\nYou should see output similar to:<\/p>\n\n\n\n
ruby 3.1.2p0 (2022-04-12 revision 0) [x86_64-linux]<\/code><\/pre>\n\n\n\nStep 5: Install Node.js and Yarn<\/h3>\n\n\n\n
Rails uses Node.js for the Asset Pipeline, and Yarn is used to manage JavaScript dependencies.<\/p>\n\n\n\n
Install Node.js<\/h4>\n\n\n\n$ sudo dnf install -y nodejs<\/code><\/pre>\n\n\n\nInstall Yarn<\/h4>\n\n\n\n
Add the Yarn repository and install Yarn:<\/p>\n\n\n\n
$ curl --silent --location https:\/\/dl.yarnpkg.com\/rpm\/yarn.repo | sudo tee \/etc\/yum.repos.d\/yarn.repo\n$ sudo dnf install -y yarn<\/code><\/pre>\n\n\n\nStep 6: Install Rails<\/h3>\n\n\n\n
Finally, install Rails using the gem package manager:<\/p>\n\n\n\n
$ gem install rails -v 7.0.3<\/code><\/pre>\n\n\n\nVerify the Rails installation:<\/p>\n\n\n\n
$ rails -v<\/code><\/pre>\n\n\n\nYou should see output similar to:<\/p>\n\n\n\n
Rails 7.0.3<\/code><\/pre>\n\n\n\nStep 7: Set Up a New Rails Application<\/h3>\n\n\n\n
To ensure everything is working correctly, create a new Rails application. Navigate to the directory where you want to create your application and run:<\/p>\n\n\n\n
$ rails new myapp\n$ cd myapp<\/code><\/pre>\n\n\n\nStep 8: Start the Rails Server<\/h3>\n\n\n\n
Start the Rails server to make sure your application is running correctly:<\/p>\n\n\n\n
$ rails server<\/code><\/pre>\n\n\n\nOpen a web browser and navigate to http:\/\/localhost:3000<\/code>. You should see the Rails welcome page, indicating that everything is set up correctly.<\/p>\n\n\n\nConclusion<\/h3>\n\n\n\n
You have successfully installed Ruby on Rails on your Rocky Linux 8.10 system. This powerful framework is now ready for you to start developing web applications. For more detailed configurations and optimizations, refer to the official documentation of each component:<\/p>\n\n\n\n
\n- Ruby Documentation<\/a><\/li>\n\n\n\n
- Rails Guides<\/a><\/li>\n\n\n\n
- RVM Documentation<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"
Ruby on Rails, often simply called Rails, is a powerful web application framework written in Ruby. It follows the model-view-controller (MVC) architecture and emphasizes convention over configuration. This guide will…<\/p>\n","protected":false},"author":1,"featured_media":14259,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,25,27,28,16,18],"tags":[193,354,424,433,449,1268,982,531,573,591,635,636],"yoast_head":"\n
How to Install Ruby On Rails on Rocky Linux 8.10 Systems<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n\t\n\t\n\t\n