How To Install ruby-parser on Ubuntu 20.04
Introduction
In this tutorial we learn how to install ruby-parser on Ubuntu 20.04.
What is ruby-parser
ruby-parser is:
ruby_parser (RP) can be used to parse and check syntax of Ruby code. “Pure Ruby” in this context means the parser’s code
- consists solely of Ruby source files
- does not add any native extensions or other C code (eg. with RubyInline) which requires a C compiler to be present on the user’s system
It utilizes racc and its output is same as that of ParseTree’s. Ruby-Versions: all
There are three methods to install ruby-parser on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install ruby-parser Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install ruby-parser using apt-get by running the following command:
sudo apt-get -y install ruby-parser
Install ruby-parser Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install ruby-parser using apt by running the following command:
sudo apt -y install ruby-parser
Install ruby-parser Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install ruby-parser using aptitude by running the following command:
sudo aptitude -y install ruby-parser
How To Uninstall ruby-parser on Ubuntu 20.04
To uninstall only the ruby-parser package we can use the following command:
sudo apt-get remove ruby-parser
Uninstall ruby-parser And Its Dependencies
To uninstall ruby-parser and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove ruby-parser
Remove ruby-parser Configurations and Data
To remove ruby-parser configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge ruby-parser
Remove ruby-parser configuration, data, and all of its dependencies
We can use the following command to remove ruby-parser configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge ruby-parser
References
Summary
In this tutorial we learn how to install ruby-parser package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.