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
pavey nganpi
1,044 Pointsrails server error
When I run rails server, I have the following error, i tried to find the other program running i couldny, i restart my computer and the problem still persist, pls help:
rails server
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-12-26 23:29:07] INFO WEBrick 1.3.1
[2013-12-26 23:29:07] INFO ruby 2.0.0 (2013-11-22) [i386-mingw32]
[2013-12-26 23:29:07] WARN TCPServer Error: Only one usage of each socket address (protocol/network address/po
rt) is normally permitted. - bind(2)
Exiting
C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:85:in `initialize': Only one usage of each socket address (protocol/
network address/port) is normally permitted. - bind(2) (Errno::EADDRINUSE)
from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:85:in `new'
from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:85:in `block in create_listeners'
from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:82:in `each'
from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:82:in `create_listeners'
from C:/Ruby200/lib/ruby/2.0.0/webrick/server.rb:132:in `listen'
from C:/Ruby200/lib/ruby/2.0.0/webrick/server.rb:113:in `initialize'
from C:/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:45:in `initialize'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in `new'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in `run'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in `start'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (req
uired)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
13 Answers
Aaron Kaye
1,740 PointsI am not all that experienced with rails but from the sounds of it that port is already being used (probably by another instance of the rail server?) Can you go to localhost:3000? Try starting the server on another port such as 'rails s -p 9001' then go to localhost:9001
pavey nganpi
1,044 Pointsthanks but am also new to rails, how can i change the server to localhost:9001
pavey nganpi
1,044 Pointshey that works thanks, i appreciate
Aaron Kaye
1,740 PointsYou're welcome! Not sure what the actual reason for it not working originally but hope that works for now
pavey nganpi
1,044 Pointsyh it works,thanks once more
pavey nganpi
1,044 Pointshey that command works on windows, but doesnt on linux, so u have any idea why,thanks
Aaron Kaye
1,740 Pointshmm thats weird? I use linux and tried it and it worked, are you sure you are in the directory of your app? If the problem was just with the windows then you might not have that error on linux. So I would make sure your inside of your project and then run the rails server command and try going to localhost:3000
pavey nganpi
1,044 Pointssorry i was wrong ,haha
pavey nganpi
1,044 Points@Aaron Kaye hi, i followed exactly what was explained in the rails4 todo lists tutorial here at treehouse on how to install rpec, but i didnt have the directories helpers,views, controller, and the rest, pls how can i generate theses directories,thanks
Michael Mersiades
6,310 PointsAaron Kaye Awesome. Thank you. I had the same problem and your advice fixed it. I can now run the server on the 9001 port.
But I'd still like to know what is using the 3000 port and how to stop it. I ran top and there doesn't appear to be any other instances of ruby running. Does anybody know what's going on?
pavey nganpi
1,044 Pointsyh, i still havent figured that problem out, am just using port 9001,
pavey nganpi
1,044 Pointshi guys when i want to post a new status, i have the following erro, i dont know why, pls help
NoMethodError in Statuses#new
Showing C:/Users/NEBELYN/Desktop/mybook/mybook/app/views/statuses/_form.html.erb where line #16 raised:
undefined method `name' for #<Status:0x4f11510>
Extracted source (around line #16):
13
14 <div class="field">
15 <%= f.label :name %><br>
16 <%= f.text_field :name %>
17 </div>
18 <div class="field">
19 <%= f.label :content %><br>
pavey nganpi
1,044 PointsAaron Kaye hi guys when i try to change my form.html.erb to implement simple_form i have this error, pls help
``` ruby undefined method `simple_form_for' for #<#Class:0x3d6c2a8:0x2d12f00>
<%= simple_form_for(@status, html: {class: "form-horizontal"}) do |f| %>
<% if @status.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@status.errors.count, "error") %> prohibited this status from being saved:</h2>````