Ruby script/server -- Errno::EADDRINUSE

hi flocks,

plz help me…

when i am trying to start the server i am getting the following error
the address is already binded plz help me to release the address…
there are no such application which takes the this address… plz help
me to release the address…

$ruby script/server
=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-04-17 16:02:20] INFO WEBrick 1.3.1
[2007-04-17 16:02:20] INFO ruby 1.8.6 (2007-03-13) [i686-linux]
[2007-04-17 16:02:20] WARN TCPServer Error: Address already in use -
bind(2)
/usr/local/lib/ruby/1.8/webrick/utils.rb:73:in initialize': Address already in use - bind(2) (Errno::EADDRINUSE) from /usr/local/lib/ruby/1.8/webrick/utils.rb:73:in new’
from /usr/local/lib/ruby/1.8/webrick/utils.rb:73:in
create_listeners' from /usr/local/lib/ruby/1.8/webrick/utils.rb:70:in each’
from /usr/local/lib/ruby/1.8/webrick/utils.rb:70:in
create_listeners' from /usr/local/lib/ruby/1.8/webrick/server.rb:75:in listen’
from /usr/local/lib/ruby/1.8/webrick/server.rb:63:in
initialize' from /usr/local/lib/ruby/1.8/webrick/httpserver.rb:24:in initialize’
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:58:in
new' ... 7 levels... from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
from script/server:3

Thanks

rookie to RoR here and also experiencing errors with

$ruby script/server

When I execute the above command, instead of WEBrick starting up, I get
an error message:

./script/…/config/boot.rb:29: undefined method ‘gem’ for main:Object
(NoMethodError) from script/server:2

I have ruby 1.8.4 installed, rubygems 0.8.11, and Rails 1.2.3

I was also pleased to get MySQL running so easily on LINUX (this is
SUSE Enterprise Desktop 10 from Novell).

I could probably find another way to start up WEBrick, but I prefer to
use the above command.

Note: This “ruby script/server” command was performed from a directory
named “shovell” that was created using the “rails shovell” command from
my home
directory, and it appears that the associated Rails application
directories
were cleanly created by “rails shovell”. This is discussed in Lenz’
book on RoR Web Applications.

Greatly appreciate in advance your valuable time in reading this and any
assistance you can give.

Regards,
ambulance_driver

A follow-up on the above notion that a different application server
might
make a difference.

After installing Mongrel, and starting up the Mongrel application server
with:

sudo mongrel_rails start -p 3000

(Above command land parameter “-p” specifieds start on port 3000)

I receive the following messages:

**Starting Mongrel listening at 0.0.0.0:3000
**Starting Rails with development environment…
/root/shovell/config/boot.rb:29: undefined method ‘gem’ for main:Object
(NoMethodError)

…many messages forward from this point…

The above message error is the same for what I received when trying
“ruby script/server” to start up the WEBrick server, so I guess on my
part is that
I have some kind of environmental problem on my LINUX distribution.

Comments? Suggestions?

-ambulance_driver

On Apr 24, 2007, at 12:53 AM, Greg Neely wrote:

(NoMethodError) from script/server:2

I have ruby 1.8.4 installed, rubygems 0.8.11, and Rails 1.2.3

Update your rubygems to >= 0.9.0

sudo gem update --system

my home
ambulance_driver
-Rob

Rob B. http://agileconsultingllc.com
[email protected]

Rob B. wrote:

On Apr 24, 2007, at 12:53 AM, Greg Neely wrote:

(NoMethodError) from script/server:2

I have ruby 1.8.4 installed, rubygems 0.8.11, and Rails 1.2.3

Update your rubygems to >= 0.9.0

sudo gem update --system

my home
ambulance_driver
-Rob

Rob B. http://agileconsultingllc.com
[email protected]

Rob,

As we say in EMS, a.k.a. “Emergency Medical Services”, a.k.a. “Earns
Money Sleeping”, U-DA-MAN…:slight_smile:

The command as root: gem update --system

configured rubygems to 0.9.2. At that point, I tried:

cd /shovell (a rails application directory)

followed by the previous “bad actor”:

ruby script/server

Mongrel booted beautifully, and:

http://0.0.0:3000

took me to the Welcome Aboard page for Rails.

Many thanks, Rob!

To return the favor, I have a small RUBY program below to read some
data from a flat file.
#!/usr/bin/ruby
buffer_as_array=IO.readlines(“testfile”)
lines=buffer_as_array.size
print “myfile has #{lines} lines in it.\n”
for x in buffer_as_array do
str=x.chomp!
t,v,d,q = str.split(" ")
print “#{t} #{v} #{d} #{q}\n”
end

Try to use the same blank delimited data and read it into objects using
Apple’s Objective-C in the XCode IDE, and the same functionality will
cost
you many more loc. LOL.

Onward and upward with Java and Ruby,
ambulance_driver (Greg Neely, M.S., NREMT-B)

Hi !!
I also faced the same problem.

I tried doing this :

=>ruby gem update --system

after that I started server using

=>ruby script/server

and It worked properly.

U do try this :slight_smile:

thanks

Subodh D. Choure

thamu … wrote:

hi flocks,

plz help me…

when i am trying to start the server i am getting the following error
the address is already binded plz help me to release the address…
there are no such application which takes the this address… plz help
me to release the address…

$ruby script/server
=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-04-17 16:02:20] INFO WEBrick 1.3.1
[2007-04-17 16:02:20] INFO ruby 1.8.6 (2007-03-13) [i686-linux]
[2007-04-17 16:02:20] WARN TCPServer Error: Address already in use -
bind(2)
/usr/local/lib/ruby/1.8/webrick/utils.rb:73:in initialize': Address already in use - bind(2) (Errno::EADDRINUSE) from /usr/local/lib/ruby/1.8/webrick/utils.rb:73:in new’
from /usr/local/lib/ruby/1.8/webrick/utils.rb:73:in
create_listeners' from /usr/local/lib/ruby/1.8/webrick/utils.rb:70:in each’
from /usr/local/lib/ruby/1.8/webrick/utils.rb:70:in
create_listeners' from /usr/local/lib/ruby/1.8/webrick/server.rb:75:in listen’
from /usr/local/lib/ruby/1.8/webrick/server.rb:63:in
initialize' from /usr/local/lib/ruby/1.8/webrick/httpserver.rb:24:in initialize’
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:58:in
new' ... 7 levels... from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
from script/server:3

Thanks

Hi Greg Neely

I have ruby 1.8.4 installed, rubygems 0.8.11, and Rails 1.2.3

Any special need you use these much old versions? My suggestion is to
upgrade to the latest versions (Rails is now 2.3.5 You can use Ruby
either 1.8.6 or 1.8.7)

Sijo