Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change local web server back to WEBrick in Rails from Puma

Tags:

I was following the Heroku docs on getting Puma set up and entered this command:

bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} 

Which made it so that now I run puma in my development environment whenever I run a rails s. But or whatever reason Puma is causing havok. How do I switch back to using WEBrick??

Tried

bundle exec webrick -p ${PORT:-3000} -e ${RACK_ENV:-development} 

But of course, command is not found: webrick. Knew that' be too easy...

Thanks!

like image 273
james Avatar asked Feb 19 '15 03:02

james


People also ask

Is Puma a Web server?

Puma is an HTTP web server derived from Mongrel and written by Evan Phoenix. It stresses speed and efficient use of memory.

How do I run a Rails server on a different port?

Go to your browser and open http://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 .


1 Answers

To run the local server in development with webrick you should only have to specify it when running rails server:

rails server webrick 

You may get it to default back to webrick again if you move puma to the production group of your Gemfile:

group :production do   gem 'puma' end 

Then bundle without the production group:

bundle install --without production 
like image 81
infused Avatar answered Sep 20 '22 00:09

infused