Effortlessly establish your ruby on rails development environment on ubuntu 22.04 jammy jellyfish. dive into seamless coding with our step-by-step guide for optimal performance and efficiency.
Creating Your Ruby on Rails Development Environment: A Comprehensive Guide
Get ready to ignite the Ruby on Rails groove on Ubuntu 22.04 Jammy Jellyfish!
Why Ubuntu, you may ask? Well, our code, like a seasoned safari guide, is destined for a Linux server, and Ubuntu, the undisputed maestro of Linux scenes, offers the easiest dance steps with loads of documentation—a perfect starting point, my friend.
For those keen to groove with Ubuntu Server, syncing your development and production servers is the key to the rhythm. Spot it on the same download link above, and let the coding safari across Google's savanna begin!
Optimizing Your System: Ruby Installation Guide for Seamless Development
To kick things off, let's set up the groundwork by installing the tools needed to compile Ruby. Open up your Terminal, and let's fire up these commands to get the job done.
sudo apt-get update sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
Now, let's get Ruby on board with a handy tool called ASDF.
We like ASDF more than other options like rbenv or rvm because it's not just about Ruby – it can also handle languages like Node.js.
Getting ASDF is as easy as pie – just a two-step thing. First, get ASDF installed, and then tell your computer it's part of the gang by adding it to your shell!
cd git clone https://github.com/excid3/asdf.git ~/.asdf echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc echo 'legacy_version_file = yes' >> ~/.asdfrc echo 'export EDITOR="code --wait"' >> ~/.bashrc exec $SHELL
After that, we can add extra tools for each language we plan to use. For building websites with Rails, we'll set up Ruby, and for the interactive stuff on our site, like buttons and forms, we'll also add Node.js for our frontend magic.
asdf plugin add ruby asdf plugin add nodejs
Installing the Latest Ruby Version: Execute the Following Commands for Default Version Configuration
asdf install ruby 3.2.2 asdf global ruby 3.2.2 # Update to the latest Rubygems version gem update --system
Ensure Consistency: Confirm the Default Ruby Version Aligns with Your Recent Installation
which ruby #=> /home/username/.asdf/shims/ruby ruby -v #=> 3.2.2
Next, Install the Latest Node.js for Effective JavaScript Management in Your Rails Applications:
asdf install nodejs 20.9.0 asdf global nodejs 20.9.0 which node #=> /home/username/.asdf/shims/node node -v #=> 20.9.0 # Install yarn for Rails jsbundling/cssbundling or webpacker npm install -g yarn