Skip to content

Instantly share code, notes, and snippets.

@jasiek
Created October 31, 2012 17:15
Show Gist options
  • Save jasiek/3988412 to your computer and use it in GitHub Desktop.
Save jasiek/3988412 to your computer and use it in GitHub Desktop.
irb(main):002:0> Net::HTTP.get(URI.parse('http://www.google.com'))
IOError: Function not implemented
from org/jruby/ext/socket/RubyTCPSocket.java:110:in `initialize'
from org/jruby/RubyIO.java:1176:in `open'
from /usr/home/jps/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/net/http.rb:762:in `connect'
from org/jruby/ext/timeout/Timeout.java:105:in `timeout'
from /usr/home/jps/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/net/http.rb:762:in `connect'
from /usr/home/jps/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/net/http.rb:755:in `do_start'
from /usr/home/jps/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/net/http.rb:744:in `start'
from /usr/home/jps/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/net/http.rb:454:in `get_response'
from /usr/home/jps/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/net/http.rb:431:in `get'
from (irb):2:in `evaluate'
from org/jruby/RubyKernel.java:1065:in `eval'
from org/jruby/RubyKernel.java:1390:in `loop'
from org/jruby/RubyKernel.java:1173:in `catch'
from org/jruby/RubyKernel.java:1173:in `catch'
from /home/jps/.rvm/rubies/jruby-1.7.0/bin/irb:13:in `(root)'
irb(main):003:0> RUBY_DESCRIPTION
=> "jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot(TM) Client VM 1.7.0_09-b05 [linux-i386]"
irb(main):004:0>
@jasiek
Copy link
Author

jasiek commented Oct 31, 2012

Missing epoll_create support in FreeBSD's linux emulation layer.

if you run an application in the linux java which wants to use the linux epoll functions (you should see "not implemented" messages in dmesg), you can start java with the argument -Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider

@jasiek
Copy link
Author

jasiek commented Oct 31, 2012

ruby -J-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider -J-Djava.net.preferIPv4Stack=true -S irb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment