Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Installing a Ruby Development Environment Installing a Ruby Development Environment Installing Ruby on Mac

Issue with Treehouse VM - Address already in use

I installed Ruby on my Mac and it worked fine. But then I installed Treehouse VM on my mac, and now when I enter bin/rails server in the terminal, I get the following in my terminal:

=> Booting WEBrick => Rails 4.1.4 application starting in development on http://0.0.0.0:3000 => Run rails server -h for more startup options => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) => Ctrl-C to shutdown server [2014-07-28 20:57:23] INFO WEBrick 1.3.1 [2014-07-28 20:57:23] INFO ruby 2.1.2 (2014-05-08) [x86_64-darwin13.0] Exiting /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/socket.rb:206:in bind': Address already in use - bind(2) for 0.0.0.0:3000 (Errno::EADDRINUSE) from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/socket.rb:206:inlisten' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/socket.rb:461:in block in tcp_server_sockets' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/socket.rb:232:ineach' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/socket.rb:232:in foreach' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/socket.rb:459:intcp_server_sockets' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/utils.rb:75:in create_listeners' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/server.rb:132:inlisten' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/server.rb:113:in initialize' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:45:ininitialize' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in new' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:inrun' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:264:in start' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/server.rb:69:instart' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in block in server' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:intap' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in server' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:inrun_command!' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in <top (required)>' from /Users/user/Desktop/projects/testapp/bin/rails:8:inrequire' from /Users/user/Desktop/projects/testapp/bin/rails:8:in <top (required)>' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:inload' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in call' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:incall' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client.rb:26:in run' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.1.3/bin/spring:48:in<top (required)>' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in load' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in<top (required)>' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Users/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /Users/user/Desktop/projects/testapp/bin/spring:16:in <top (required)>' from bin/rails:3:inload' from bin/rails:3:in `<main>'

Is there a way to fix this or change the port? I think the Treehouse VM may be using the same port.

Thanks

1 Answer

Matthew Atkins
Matthew Atkins
22,916 Points

Did you try turning off your Treehouse VM?

vagrant suspend