Rails server not works - yesterday worked fine

Hello there,
I’ve a big problem – I come now PC and started rails server and I got
this huge report of errors. The rails server is not running, I’ve any
idea, what is wrong. Yesterday everything worked yet…

The statement after command “rails server” is here:

=> Booting Mongrel
=> Rails 3.0.5 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/tcphack.rb:12:in
initialize_without_backlog': Address already in use - bind(2) (Errno::EADDRINUSE) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/tcphack.rb:12:in initialize’
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:93:in
new' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:93:in initialize’
from
/Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/handler/mongrel.rb:10:in
new' from /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/handler/mongrel.rb:10:in run’
from /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/server.rb:213:in
start' from /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands/server.rb:65:in start’
from
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:30
from
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27:in
tap' from /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in gem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `require’
from script/rails:6

Can me please someone help, what to do with this problem? I see this
first time and I am confused from it…

Thanks million times!

Address already in use - bind(2)

I mean I could been saying more, but you just have to figure it out.
Don’t afraid to look at the error messages.

On Tue, Mar 15, 2011 at 12:47 AM, Vladimir R.

The address is already in use. Easiest solution, just restart your PC.
You could have left a process running rails without realizing it. You
could try to find and kill the process, but a quick reboot should
solve the problem.

If it doesn’t then you have probably installed something else that’s
conflicting with the port Rails is trying to start on.

Best Wishes,
Peter

On 14 March 2011 21:39, Manny 777 [email protected] wrote:

=> Ctrl-C to shutdown server
Exiting

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/tcphack.rb:12:in

`initialize_without_backlog’: Address already in use - bind(2)
(Errno::EADDRINUSE)

This is the error that you’re looking for. It means that another
process (perhaps your rails server from yesterday?) is still listening
on port 3000, so your new server can’t bind to it.

You can either:

  • find the old server process and terminate it; or
  • start the new server on a different port (for example: rails server -p
    3001).

Chris

Thanks guys for your hints, I tried to restart PC and started rails
server again. But I got more errors:

=> Booting Mongrel
=> Rails 3.0.5 application starting in development on
http://0.0.0.0:3001
=> Call with -d to detach
=> Ctrl-C to shutdown server
Mon Mar 14 23:07:16 +0100 2011: Read error: #<NameError: uninitialized
constant ActiveSupport::Dependencies>
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/stack.rb:9:in
initialize' /Library/Ruby/Gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/stack.rb:67:in new’
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/stack.rb:67:in
use' /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:190:in default_middleware_stack’
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:189:in
tap' /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:189:in default_middleware_stack’
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:161:in
app' /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:168:in call’
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in
send' /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in method_missing’
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/rack/log_tailer.rb:14:in
call' /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/content_length.rb:13:in call’
/Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/chunked.rb:15:in call' /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/handler/mongrel.rb:67:in process’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
process_client' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in each’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
process_client' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in new’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in initialize’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in run’
/Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/handler/mongrel.rb:38:in
run' /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/server.rb:213:in start’
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands/server.rb:65:in
start' /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:30 /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27:in tap’
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in
gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in require’
script/rails:6

It looks perhaps on the biggest problem :confused:

Hi Vladimir,
I’m newbie in RoR and I don’t now, what this line mean… what I must
to fix/what is wrong?

I’m sorry for these stupid questions…

Hey,

restart or use the line which others alreay gave you:
“rails server -p 3001”
because it 'll start your server on another port which is not in use
yet.

If you’re beginner try these sources:

You can browse almost all problems which you’ll have using:
Google

just use the tags.

Also you may have problem with Gem dependencies. You can find all gems
you need here:
https://rubygems.org/
check ‘gem list’ to see your gems, and you can use "gem update
to update any gem. For example ‘gem list mongrel’ and ‘gem
update mongrel’ may help you.

On Unix based system definitely use Ruby Version manager. I think on
Win there is smthg similar (tak?).

Good luck,
Zoli