1. Operating environment
Ubuntu 18.04.2 LTS
2. Install Ruby
apt install ruby-full -y
Judging that the installation is complete
ruby --version
gem --version
3. Install sqlite3
apt install libsqlite3-dev -y
4. Install node.js
apt install nodejs -y
apt install npm -y
5. Install yarn
npm install -g yarn
6. Generate hello web application
rails new hello
7. Start the application
cd hello
rails server
Default port 3000
8. Access the application
localhost:3000 defaults to local access, and can be set to 0.0.0.0:3000 that can be accessed by the LAN
Change the boot mode to
rails server -b 192.168.1.58 (就是你的ip地址)
rails server -b 0.0.0.0
The result is successful: