$ su
$ apt-get install sudo
$ nano /etc/sudoers
-
Below of
%sudo ALL=(ALL:ALL) ALL
:yourUsername ALL=(ALL:ALL) ALL
-
Then run
sudo apt-get update sudo apt-get upgrade
- 1 :
$ cat /proc/sys/vm/swappiness
- 2 :
$ sudo nano /etc/sysctl.conf
- On nano editor, go to the bottom of the page and add
vm.swappiness=10
- On nano editor, go to the bottom of the page and add
- 3 : Reboot your system and run again the first command
sudo apt update
sudo apt upgrade
$ sudo apt install gcc make libssl-dev libreadline-dev zlib1g-dev libsqlite3-dev
$ sudo apt install git
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exit
$ mkdir -p "$(rbenv root)"/plugins
$ git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
$ rbenv -v
# Output: rbenv 1.2.0-14-xxxxx
$ rbenv install 2.7.4 --verbose
- Then
$ rbenv global 2.7.4
$ ruby -v
# Output:
# ruby 2.7.4pxxx (xxxx revision xxxxx)[x86_64-linux]
$ gem install rails -v 6.0.4.8
$ rails -v
# Output:
# Rails 6.0.4.8
sudo apt install mariadb-server
sudo mysql_secure_installation
- Then
- Switch to unix_socket authentication [Y/N] n
- Change the root password? [Y/N] n
- Remove anonymus users? [Y/N] y
- Disallow root login remotely? [Y/N] y
- Remove test database and access to it? [Y/N] y
- Reload privilege tables now? [Y/N] y
$ sudo mysql
- CREATE USER 'yourUsername'@'localhost' IDENTIFIED BY '_pa$$w0rd_';
- GRANT ALL ON *.* TO 'yourUsername'@'localhost' WITH GRANT OPTION;
- FLUSH PRIVILEGES;
- EXIT
$ sudo systemctl status mariadb
$ sudo systemctl start mariadb
If you already have a mysql installed on your local environment maybe you will find a troubles like this:
“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”
We will remove mysql with the following commands
$ sudo apt-get remove --purge mysql-server mysql-client $ mysql-common -y
$ sudo apt-get autoremove -y
$ sudo apt-get autoclean
$ sudo rm -rf /etc/mysql
$ sudo find / -iname 'mysql*' -exec rm -rf {} \;