I am getting following error when I am trying to connect the FTP server
ftp = Net::FTP::new("example.sg","username","password")
Errno::ECONNREFUSED: Connection refused - Connection refused
from org/jruby/ext/socket/RubyTCPSocket.java:121:in `initialize'
from org/jruby/RubyIO.java:876:in `new'
from org/jruby/ext/socket/RubyTCPSocket.java:147:in `open'
from /opt/jruby/lib/ruby/1.8/net/ftp.rb:159:in `open_socket'
from /opt/jruby/lib/ruby/1.8/net/ftp.rb:175:in `connect'
from /opt/jruby/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
from /opt/jruby/lib/ruby/1.8/net/ftp.rb:174:in `connect'
from /opt/jruby/lib/ruby/1.8/net/ftp.rb:136:in `initialize'
from (irb):7:in `evaluate'
from org/jruby/RubyKernel.java:1083:in `eval'
from /opt/jruby/lib/ruby/1.8/irb.rb:158:in `eval_input'
from /opt/jruby/lib/ruby/1.8/irb.rb:271:in `signal_status'
from /opt/jruby/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1410:in `loop'
from org/jruby/RubyKernel.java:1183:in `catch'
from /opt/jruby/lib/ruby/1.8/irb.rb:154:in `eval_input'
from /opt/jruby/lib/ruby/1.8/irb.rb:71:in `start'
from org/jruby/RubyKernel.java:1183:in `catch'
from /opt/jruby/lib/ruby/1.8/irb.rb:70:in `start'
from /opt/jruby/bin/jirb:13:in `(root)
I am able to access the same website from a browser using ftp://example.sg. Any ideas why net/ftp would have issues accessing the site?