Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8953775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:10:27+00:00 2026-06-15T14:10:27+00:00

Here’s the program(1.rb): require ‘rack’ my_rack = lambda { |env| [200, {}, [Hello. The

  • 0

Here’s the program(1.rb):

require 'rack'

my_rack = lambda { |env| [200, {}, ["Hello.  The time is: #{Time.now}"]] }
handler = Rack::Handler::WEBrick

handler.run(my_rack, :PORT => 12_500)

Here’s the error:

~/ruby_programs$ ruby 1.rb 
[2012-12-07 21:49:09] INFO  WEBrick 1.3.1
[2012-12-07 21:49:09] INFO  ruby 1.9.3 (2012-04-20) [x86_64-darwin10.8.0]
[2012-12-07 21:49:09] WARN  TCPServer Error: Permission denied - bind(2)
[2012-12-07 21:49:09] WARN  TCPServer Error: Permission denied - bind(2)
/Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/utils.rb:85:in `initialize': Permission denied - bind(2) (Errno::EACCES)
    from /Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/utils.rb:85:in `new'
    from /Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/utils.rb:85:in `block in create_listeners'
    from /Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/utils.rb:82:in `each'
    from /Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/utils.rb:82:in `create_listeners'
    from /Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:82:in `listen'
    from /Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:70:in `initialize'
    from /Users/7stud/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:45:in `initialize'
    from /Users/7stud/.rvm/gems/ruby-1.9.3-p194@programming/gems/rack-1.4.1/lib/rack/handler/webrick.rb:10:in `new'
    from /Users/7stud/.rvm/gems/ruby-1.9.3-p194@programming/gems/rack-1.4.1/lib/rack/handler/webrick.rb:10:in `run'
    from 1.rb:5:in `<main>'
~/ruby_programs$ 

Here’s line 85 of ../webrick/utils.rb:

sock = TCPServer.new(ai[3], port)

If I replace the code in 1.rb with this:

require 'socket'

server = TCPServer.new 12_000 # Server bind to port 2000

loop do
  client = server.accept    # Wait for a client to connect
  client.puts "Hello !"
  client.puts "Time is #{Time.now}"
  client.close
end

I don’t get any errors, and if I enter the address:

http://localhost:12000/

in my browser, I get the expected output:

Hello !
Time is 2012-12-07 18:58:15 -1000

The permissions for the .rvm directory:

~$ ls -al
total 208
...
drwxr-xr-x  30 7stud  staff   1020 Aug 31 11:09 .rvm
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:10:29+00:00Added an answer on June 15, 2026 at 2:10 pm

    The option Port should be in PascalCase

    require 'rack'
    
    my_rack = lambda { |env| [200, {}, ["Hello.  The time is: #{Time.now}"]] }
    handler = Rack::Handler::WEBrick
    
    handler.run(my_rack, :Port => 12_500)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is my program to find all the subsets of given set. To solve
Here's the situation, i want to have a user that can enter time on
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it
Here is what I am currently doing. PHP echo's out the recent post in
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.