With the recent release of Ruby 3.0, I thought it’d be a good idea to make my first post of the year on a quick how-to guide to installing the new (or any) version of Ruby.
How to install Homebrew on Mac What you need. Before you install Homebrew on Mac, you’ll need to make sure you have the following: A 64-bit Intel CPU or an Apple Silicon CPU (i.e., an M1 Mac) You can check if you have a compatible Mac by pressing cmd + spacebar, typing “About This Mac”, pressing return, and then checking the Processor. Install with a version manager such as asdf, chruby, rbenv, or rvm if you need to switch among Ruby versions (instructions for rbenv are below). See the guide Install Ruby on Mac for details and recommendations. To run the latest Ruby version you need to install it through Homebrew. Installing MongoDB on Mac (Catalina and non-Catalina) 14th Feb 2020. I had to reconfigure my Macbook after sending it for repairs. During the reconfiguration period, I noticed the instructions I linked to in “Setting up a local MongoDB connection” were outdated.
Homebrew
The only thing you’ll need before we get started is brew
installed on your machine.
If you don’t have brew
, install it by running the following command:
Ruby Install
Once you have brew
, you’re ready to go! First, we must install a tool Postmodern/ruby-install to get the version of Ruby that we want:
Now we can download and install any version of ruby available. If we want Ruby 3.0:
or for latest version:
Voila! You can now install any version of Ruby you choose.
If you need to utilize multiple versions of Ruby and will need to switch back and forth between versions, you may use the corresponding chruby
tool here Postmodern/chruby.
Then, to switch between versions:
In this tutorial we will learn to install TypeScript on Mac using NPM a NodeJS package manager.
Homebrew is a package manager for Mac and helps to easily install and uninstall softwares on a Mac.
To install Homebrew run the following command in the terminal.
For more detail on Homebrew check their website.
Once you have homebrew installed on your system you can use it to install many packages.
By installing NodeJS you will also get NPM which is Node package manager. It will help you to install other packages.
To install Node on your Mac using Homebrew type the following command.
Once you have Node installed you can check its version by typing the following command in the terminal.
And, to check the version of NPM type the following command in the terminal.
Click here to read the tutorial on How to install NodeJS on Mac.
So, now we have Node and NPM installed on our system. Time to install TypeScript using NPM.
We will install TypeScript globally on our Mac so that we can access it from any directory. For this we will use the following command.
You may have to use sudo
if you don't have permissions.
Output
Once you have TypeScript installed use the following command to check the version.
Output
Lets say, we have a project folder example and we have an app.ts TypeScript file which we want to convert into JavaScript file.
The content of app.ts file is given below.
To convert app.ts file into app.js file we use the following command in the terminal.
Output
To uninstall TypeScript globally we use the following command.
You may have to use sudo
if you don't have the permissions.
Output
And that's all for this tutorial. Have fun coding.