Rails will not run server

Viewed 1803

I am currently learning Ruby on Rails on my Win10 machine, and the server refuses to run.

$ rails server
Could not find server "".
Run `rails server --help` for more options.

I tried to find an answer, but can not find one. Yes I am in the project root.

2 Answers

For people running Ruby 3.0, since Webrick isn't shipped by default anymore, if you still want to use it, you need to add it to your Gemfile:

gem 'webrick', '~> 1.7'

Rails does not find a server to use, it happened to me upgrading a Rails 5.x to 6.x project. The way to solve was to add on my Gemfile:

gem 'puma', '~> 5.2'

Of course you could try different servers like unicorn or thin as @jvillian shared on his article.

Related