Improve Article Show Save Article Prerequisite: Ruby Programming Language Downloading and Installing RubyAll the versions of Ruby for Windows can be downloaded from rubyinstaller.org. Download the latest version and follow the further instructions for its
Installation. Beginning with the installation: Installing MYSYS2 Components: To check if Ruby installed correctly, perform a version check for the same using the following command on the command-line: ruby -v Here’s a sample Program to begin with the use of Ruby Programming: If you're using Ruby on a Mac, it is set up by default, but you can't modify or upgrade it. Most developers don't use the pre-installed version of Ruby on their Macs. Instead, they configure several systems to help them manage Ruby installation (and other programs), and manage different versions of Ruby. In this lesson, we'll cover installing the version of Ruby and version management tools that are used on Epicodus computers. Take note: if you run into any error that prevents you from completing all of the installation steps in this lesson, you should still continue with the remaining installation pre-work by installing Postgres. Also make sure to take detailed notes on any issues that come up, the troubleshooting steps you took to address those issues, and any helpful resources you found along the way. You can share these notes with your peers, and they can share their notes with you. We'll install Ruby using Homebrew InstallationIf you do not have Homebrew installed yet, you may install it now by copy and pasting this command into the command line:
This installs Homebrew on your device, a package manager for OS X that makes it easy to install developer software. Next, ensure Homebrew packages are run before the system versions of the same (which may be dated or not what we want) by executing the following: For bash users: For zsh users: Install ruby-installTo install
Install RubyTo install the version of Ruby we use at Epicodus, run this command:
If you get the following error
Optionally, you can run Install and Configure chrubyTo install
Next, configure your shell's environment variables for For bash users:
For zsh users:
To set your default Ruby version to 3.1.2, run this command:
The last configuration I'd recommend is to not install documentation when you install Ruby gems. Why? It takes longer than installing the gems themselves, and better documentation is available online. Optionally, run this command:
Verify Your Ruby InstallationIn your Terminal, run this command to verify the version of Ruby you've installed:
Also, confirm that you can access IRB (a REPL, which we'll learn more about soon):
To exit IRB, enter Install RailsFinally, verify that you can install Rails at the same version we use at Epicodus:
You can verify that Rails is working by navigating to the desktop and creating a new project:
It will take a little time for Rails to spin up a new project. Once it's complete,
You should see a message similar to the following:
If not, remember to copy and paste the entire error log into a document that you can share with your instructor. To close the server enter After you've completed these steps, delete the And with that, you're ready to go! Next stepsCheck out the READMEs for chruby and ruby-install, or at least bookmark them for later, so you know how to install other versions of Ruby and switch between them as needed. There's also an upcoming lesson on Managing Ruby Versions that goes into detail about using the tools ruby-install and chruby. Otherwise, continue working through the Ruby and Rails pre-work! Lesson 3 of 7 Is Ruby installed on Linux?Depending on your distribution, Ruby may or may not be pre-installed on your Linux system. If not, you can install it with your package manager, e.g., RPM, Yum, DPKG, etc. Regardless, the ruby program will end up in the /usr/bin and /usr/lib/ruby directories, just like on a Mac.
What is the command to install rails?Step 1: Type the following command in the ruby terminal: $ gem install rails. ... . Step 2: To verify that rails have been installed, type the following command and it should report its version. ... . Step 3: To make your first web application in rails type the following command in the command line: $ rails new project.. What is Ruby Installer?This is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more. Download. Add-ons.
Can you install Ruby on Windows?Downloading and Installing Ruby
All the versions of Ruby for Windows can be downloaded from rubyinstaller.org. Download the latest version and follow the further instructions for its Installation.
|