0

I just started learning RoR as a backend technology for React. I came across a tutorial that uses 'react-rails' and it chooses the localhost port number to be 3000 for my development environment by default.

Is there any way to change this default port number?

Raj
  • 2,888
  • 3
  • 25
  • 46

2 Answers2

1

In development environment(local machine) you can not use port number below 1024

To start rails server on different port: -

rails s -p 5000 #or you can set your own port (> 1024)

Or to start is on port 80 or less than 1024:-

rvmsudo rails server -p 80
Anand
  • 6,042
  • 3
  • 11
  • 25
0

The below mentioned link will help you regarding the port and address while running rails server

Change my default localhost port in Rails 5.

Rohan
  • 2,551
  • 1
  • 10
  • 17