yum update -y
yum install -y git
yum install -y bzip2 gcc openssl-devel readline-devel zlib-devel
dnf module list ruby
dnf module -y install ruby:2.5
ruby -v
dnf -y install ruby-devel rpm-build make gcc gcc-c++ gcc-gdb-plugin libxml2 libxml2-devel mariadb-devel zlib-devel libxslt-devel nodejs
gem install bundler
gem install nokogiri -- --use-system-libraries
gem install rails --version="~>5.0" --no-ri --no-rdoc
rails -v
gem install mysql2 --no-ri --no-rdoc -- --with-mysql-config=/usr/bin/mysql_config
rails new SampleApp -d mysql
cd SampleApp
vi config/database.yml
default: &default
adapter: mysql2
encoding: utf8
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: root
password: password #MariaDB connection password
socket: /var/lib/mysql/mysql.sock
dnf info mariadb-server mariadb mariadb-devel
dnf install -y mariadb-server mariadb mariadb-devel
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
mysql_secure_installation
rails db:create
rails generate scaffold testapp name:string title:string body:text
rails db:migrate
rails server --binding=0.0.0.0
setenforce 0
firewall-cmd --zone=public --add-port=3000/tcp --permanent
firewall-cmd --reload
http://172.16.1.xxx:3000/
Recommended Posts