Raj
Raj

Reputation: 4079

change localhost port number in a rails application

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?

Upvotes: 0

Views: 6247

Answers (2)

Rohan
Rohan

Reputation: 2727

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

Change my default localhost port in Rails 5.

Upvotes: 0

Anand
Anand

Reputation: 6531

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

Upvotes: 1

Related Questions