Facing a problem in setting up the web server in Rails.
I am doing an advanced Ruby on Rails Course and even I have completed many lessons in it. Now I am creating my first web application but facing a problem in setting up the web server.
This is the syntax I am using-
$ bin/rails server
Can anyone suggest me easy way to set up the server?
Thanks
The bin/rails server command launches a web server named Puma which comes bundled with Rails. You'll use this any time you want to access your application through a web browser.
With no further work, bin/rails server will run our new shiny Rails app:
$ cd my_app
$ bin/rails server
=> Booting Puma
=> Rails 7.0.0 application starting in development
=> Run bin/rails server --help
for more startup options
Puma starting in single mode...
- Version 3.12.1 (ruby 2.5.7-p206), codename: Llamas in Pajamas
- Min threads: 5, max threads: 5
- Environment: development
- Listening on tcp://localhost:3000 Use Ctrl-C to stop Copy With just three commands we whipped up a Rails server listening on port 3000. Go to your browser and open Localhost:3000, you will see a basic Rails app running.
You can also use the alias "s" to start the server: bin/rails s.
The server can be run on a different port using the -p option. The default development environment can be changed using -e.
$ bin/rails server -e production -p 4000
Copy
The -b option binds Rails to the specified IP, by default it is localhost. You can run a server as a daemon by passing a -d option.