0
votes

I have had this problem for a while but have found no solution. I am building a forums application in rails. I had just finished adding bootstrap and the bootstrap gem to my project. I go to run the server and it exits with a huge error. Here it is. Julies-MacBook-Air:railsnew juliechopourian$ rails server => Booting Puma => Rails 5.0.0.1 application starting in development on http://localhost:3000 => Runrails server -hfor more startup options Puma starting in single mode... * Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://localhost:3000 Exiting /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:266:ininitialize': Address already in use - bind(2) for "::1" port 3000 (Errno::EADDRINUSE) from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:266:in new' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:266:inadd_tcp_listener' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:260:in block in add_tcp_listener' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:259:ineach' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:259:in add_tcp_listener' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:102:inblock in parse' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:85:in each' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:85:inparse' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/runner.rb:133:in load_and_bind' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/single.rb:85:inrun' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/launcher.rb:172:in run' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/rack/handler/puma.rb:51:inrun' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:296:in start' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:79:instart' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:90:in block in server' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:intap' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in server' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:inrun_command!' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in <top (required)>' from /Users/juliechopourian/treehouse/rails_app/railsnew/bin/rails:9:inrequire' from /Users/juliechopourian/treehouse/rails_app/railsnew/bin/rails:9:in <top (required)>' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:inload' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in call' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:incall' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in run' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/bin/spring:49:in' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in load' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Users/juliechopourian/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /Users/juliechopourian/treehouse/rails_app/railsnew/bin/spring:13:in <top (required)>' from bin/rails:3:inload' from bin/rails:3:in <main>' Julies-MacBook-Air:railsnew juliechopourian$

I think it might have something to do with the puma gem but I really don't know. Any help would be very appreciated. Tell me if I need to post any more of my project.

2
EADDRINUSE <- some other process is taking port 3000. Do you have anything else running that might do that? Can you change your local development port to not conflict with any others?Makoto
Sometimes you can forget to terminate last terminal session, counter check that or follow localhost:3000 in your browser and see what happenEmmanuel Mtali

2 Answers

3
votes

rails 5

ps aux | grep 3000

if rails app still running

user 3454 0.6 5.6 1708124 220676 pts/5 Sl+ 20:18 0:20 puma 3.6.0 (tcp://localhost:3000)

kill -9 3454

or

rails s -p 3001

1
votes

Watch this Address already in use - bind(2) for "::1" port 3000 (Errno::EADDRINUSE)

Something is already listening on port 3000. Be sure you don't have other ruby processes listening to that port. Something like

ps aux | grep ruby