[Ruby on Rails] From application creation to server startup & what is the port number?

This is a summary of the basics of Ruby on Rails.

1. Create an application.

Start the terminal.

$rails new application name

By executing the above command, a folder with the same name as the entered application name will be created, and the folders and files required for development will be prepared in it.

Application name/
  ├ app/Application main folder
  ├ config/Folder for setting information
  ├ db/Database related folders
  └:Other

2. Start the server.

Enter in terminal

$ rails server

Open localhost on port 3000 in a browser such as Google Chrome or Safari.

localhost:3000

スクリーンショット 2020-08-09 9.27.41.png Ruby on Rails has started successfully.

Reference: Ruby on Rails5 Learning Course I | If you are an introduction to programming, you can learn from the basics Progate [Progate]

What is a port number?

This time, it came out as port 3000, but the word port number is indispensable for knowledge related to infrastructure.

Internet terminology 1 minute explanation-What is a port number --- JPNIC explains as follows. I will.

The port number is a number that identifies the program that the computer uses for communication in TCP / IP communication. The port number is a 16-bit integer, ranging from 0 to 65535.

At a deeper level, there are roughly three types of port numbers.

It is classified as above.

By the way, this time, port 3000 is used by default for Ruby on Rails, and port 8000 is used for Django, but since these 3000 and 8000 correspond to registered port numbers (1024 to 49151). , IANA is now accepting registrations and publishing them.

What is IANA?

Abbreviation for Internet Assigned Numbers Authority. It is a function to manage Internet resources such as domain name, IP address and AS number, protocol name and number used in each protocol. IANA was founded in 1988 by the late Jonathan Bruce Postel of the Information Sciences Institute (ISI) at the University of Southern California. IANA is one of the oldest institutions on the Internet, and its activities can be traced back to the 1970s. After that, ICANN was established in October 1998, and the role of IANA's global management and coordination of various resources was taken over as a part of ICANN. For that reason, it is used to represent the function of managing Internet resources, including historical ones. Quote: JPRS Glossary | IANA

TCP / IP communication and HTTP can be deepened further, so I will write an article if I have a chance.

Recommended Posts

[Ruby on Rails] From application creation to server startup & what is the port number?
A note on how to check the connection to the license server port
What to do if the inode is exhausted on EC2 Linux
Try using the Python web framework Django (1)-From installation to server startup
Is the number equivalent to an integer?
Kill the frozen Rails local application server (Puma)
POST images from ESP32-CAM (MicroPython) to the server
[Introduction to Udemy Python 3 + Application] 54. What is Docstrings?
Find a guideline for the number of processes / threads to set in the application server
Introduction to AI creation with Python! Part 1 I tried to classify and predict what the numbers are from the handwritten number images.
Until the web application is released on Sakura VPS
How to know the port number of the xinetd service
Send log data from the server to Splunk Cloud
Try to estimate the number of likes on Twitter
How to know the number of GPUs from python ~ Notes on using multiprocessing with pytorch ~