login as root.
install ruby 3.3.7 (ruby 3.4 wont work – there are some errors).
pkg_add ruby
install ruby-shim to automatically select ruby executable, avoiding typing ruby33 or ruby34, etc.
pkg_add ruby-shim
test ruby version.
ruby -v
install rails latest version.
gem install rails
test rails version (somehow the rails executable will follow ruby version installed which is 3.3).
rails33 -v
Dont forget to install git.
pkg_add git
Test rails new app.
rails33 new myapp