Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails will not run server

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

$ rails server
Could not find server ''. (Rails::Command::Base::CorrectableError)
Run `bin/rails server --help` for more options.

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

like image 427
drip drip Avatar asked Jan 25 '23 18:01

drip drip


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'
like image 80
Robin Avatar answered Jan 29 '23 08:01

Robin


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.

like image 25
Jorge Sampayo Avatar answered Jan 29 '23 09:01

Jorge Sampayo