📅  最后修改于: 2023-12-03 14:47:08.465000             🧑  作者: Mango
Ruby is a popular programming language used for web development, data analysis, and automation. Before you can start coding with Ruby, you need to install it on your machine. In this guide, we'll walk you through the steps to install Ruby on your system using Shell-Bash.
Before installing Ruby, you need to make sure that your system has the required dependencies installed. This includes:
To install these dependencies on a Ubuntu system, run the following command:
sudo apt update
sudo apt install -y build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev git
For other Linux distributions, refer to their package manager documentation.
Once the dependencies are installed, you can proceed with the Ruby installation process.
wget https://cache.ruby-lang.org/pub/ruby/$(echo "$(curl -sSL https://www.ruby-lang.org/en/downloads/ | grep 'ruby-\d' | tail -n 1 | cut -d '"' -f 2 | cut -d '/' -f 4)"/$(curl -sSL https://www.ruby-lang.org/en/downloads/ | grep 'ruby-\d' | tail -n 1 | cut -d '"' -f 2)) && \
tar -zxvf ruby-* && \
cd ruby-* && \
./configure && \
make && \
sudo make install
This command will download the latest stable version of Ruby, extract it, configure it, and then build and install it on your system.
ruby -v
This will output the version of Ruby installed on your system.
Congratulations! You have successfully installed Ruby on your system using Shell-Bash. You're now ready to start coding with Ruby and build amazing applications. Happy coding!