Skip to main content

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

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation 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**

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 2 Installing the mysql service

3. Create mysql database,

sudo mysql

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 3 Entering the mysql command line

SQL language to create a new database

CREATE DATABASE redmine CHARACTER SET utf8mb4;

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation 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';_*

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 5 Create mysql user account

Exit the mysql command line

exit

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation 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:

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation 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

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 8 apt intall installs Ruby tools

ruby -v

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation 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:

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation 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:

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 11 Decompressing ruby

3. Enter the ruby ​​decompression directory and run the following instructions to configure ruby.

./configure

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 12 Configuring ruby

4. Run the following instructions to compile ruby.

make

Installing redmine software on ubuntu18.4 (1) - database creation and ruby �​​installation Figure 13 Compile ruby

5. Run the following command to install ruby.

sudo make install

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 14 Install ruby

6. Restart and check the ruby ​​version number, as shown in the figure below, indicating that the installation is successful.

Installing redmine software on ubuntu18.4 (1) - database creation and ruby ​​installation Figure 15 Check the newly installed ruby ​​version