Installing redmine software on ubuntu18.4 (1) - database creation and ruby installation
Installing redmine software on ubuntu18.4 (1) - database creation and ruby installation
This article introduces the preliminary environment preparation work for installing redmine software on ubuntu18.4, including mysql database installation, mysql database creation and ruby installation, etc.
(1) Install mysql and create a mysql database
1. First, update the apt package index
sudo apt update
Figure 1 Update application package index
2. Then install the mysql service. After the mysql installation is completed, the service will automatically start when booting.
sudo apt install mysql-server
or** sudo apt-get install mysql-server**
Figure 2 Installing the mysql service
3. Create mysql database,
sudo mysql
Figure 3 Entering the mysql command line
SQL language to create a new database
CREATE DATABASE redmine CHARACTER SET utf8mb4;
Figure 4 SQL statement to create database
Creating Mysql user account than giving access
_GRANT ALL ON redmine. TO 'redmine'@'localhost' IDENTIFIED BY 'change-with-strong-password';_*
Figure 5 Create mysql user account
Exit the mysql command line
exit
Figure 6 Exit the mysql command line
(2) Install ruby
According to redmine's official instructions, the Redmine 4.2 version installed in this section requires that the ruby version must be version 2.7.2 or higher, as shown in the following figure:
Figure 7 Redmine official website requirements for ruby version
Ubuntu18.4 uses the apt install ruby-full command to install the ruby package. The latest version can only be installed to version V2.5, which does not meet the requirements for using ruby2.7.2 or higher.
sudo apt install ruby-full
Figure 8 apt intall installs Ruby tools
ruby -v
Figure 9 can only be installed to version V2.5.1
In order to install Ruby 2.7.2 version, this section uses downloading the Ruby source code, compiling and installing. The specific process is as shown in the figure below:
1. Enter the ruby local image download webpage: https://cache.ruby-china.com/pub/ruby/2.7/, and download the 2.7.2 version compressed package, as shown in the figure below:
Figure 10 Download ruby2.7.2 version software
2. Copy the ruby2.7.2 compressed package to the working directory, and decompress the ruby2.7.2 compressed package, as shown in the following figure:
Figure 11 Decompressing ruby
3. Enter the ruby decompression directory and run the following instructions to configure ruby.
./configure
Figure 12 Configuring ruby
4. Run the following instructions to compile ruby.
make