# Can't convert Fixnum into String (TypeError)

**URL:** <https://www.ruby-forum.com/t/cant-convert-fixnum-into-string-typeerror/209226>\
**Category:** IronRuby\
**Created:** [July 8, 2011, 6:16pm UTC](https://www.ruby-forum.com/t/cant-convert-fixnum-into-string-typeerror/209226 "2011-07-08T18:16:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [July 8, 2011, 6:16pm UTC](https://www.ruby-forum.com/t/cant-convert-fixnum-into-string-typeerror/209226/1 "2011-07-08T18:16:27Z")

</div>

This program works with ruby and jruby but it does not work with iron  
ruby. I get the following error:

multi-client-tcp-server.rb:29: can’t convert Fixnum into String  
(TypeError)

I’m new to ruby. Can someone help me fix this so it will work with both  
ruby, jruby and ironruby?

Thanks!  
Siegfried

#!/usr/bin/ruby

# 

# [Ruby - Socket Programming | Tutorialspoint](http://www.tutorialspoint.com/ruby/ruby_socket_programming.htm)

require ‘socket’ # Get sockets from stdlib

server = TCPServer.open(2000) # Socket to listen on port 2000  
print “hello\n”  
loop { # Servers run forever  
Thread.start(server.accept) do |client|  
client.puts(Time.now.ctime) # Send the time to the client  
client.puts “Closing the connection. Bye!”  
client.close # Disconnect from the client  
end  
}
