install ruby

yay -S ruby

gem 换源

gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
gem sources -l

install rails

gem install rails

add PATH to .bashrc

#ruby path
export PATH="/home/andrew/.local/share/gem/ruby/3.0.0/bin:$PATH"

bundle 换源

bundle config mirror.https://rubygems.org https://mirrors.tuna.tsinghua.edu.cn/rubygems

install gems use bundle

bundle install

use guard

#Generate an empty Guardfile with:
bundle exec guard init livereload
#Run Guard through Bundler with:
bundle exec guard

generate controller

rails g controller

generate model

rails g model Post

init livereload on serve

bundle exec guard init livereload