4

I want to run a ruby script on my Raspberry Pi. I've installed ruby via rvm. I'm sure, i'm using the right version:

$ rvm current
ruby-1.9.3-p194

when i run my script, then i get following:

./test.rb 
/home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/port_prober.rb:25:in `initialize': Address family not supported by protocol - socket(2) (Errno::EAFNOSUPPORT)
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/port_prober.rb:25:in `new'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/port_prober.rb:25:in `block in free?'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/port_prober.rb:23:in `each'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/port_prober.rb:23:in `free?'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/port_prober.rb:5:in `above'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/chrome/service.rb:33:in `default_service'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/chrome/bridge.rb:14:in `initialize'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver.rb:37:in `new'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver.rb:37:in `for'
from /home/pi/.rvm/gems/ruby-1.9.3-p194/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver.rb:65:in `for'
from ./test.rb:82:in `block in <main>'
from ./test.rb:54:in `each'
from ./test.rb:54:in `<main>'

Any ideas, what is wrong? I've tried to restart, this doesn't solve the problem...

edit: here the content of test.rb

#!/usr/bin/env ruby
# encoding: utf-8

require 'selenium-webdriver'
require 'headless'

headless = Headless.new
headless.start

driver = Selenium::WebDriver.for :chrome
driver.get "http://www.google.com" 

headless.destroy
cupakob
  • 1,057
  • 3
  • 13
  • 17

1 Answers1

1

So...i've disabled ipv6. For that, i made changes in the files /etc/modprobe.d/ipv6.conf and /etc/hosts. They looks as follow:

/etc/modprobe.d/ipv6.conf

# Don't load ipv6 by default
alias net-pf-10 off
alias ipv6 off

/etc/hosts

127.0.0.1       localhost
#::1            localhost ip6-localhost ip6-loopback
#fe00::0                ip6-localnet
#ff00::0                ip6-mcastprefix
#ff02::1                ip6-allnodes
#ff02::2                ip6-allrouters

127.0.1.1       raspberrypi

Now i get another exception, but this is a problem with my chromedriver (unable to connect to chromedriver http://127.0.0.1:9515 (Selenium::WebDriver::Error::WebDriverError) and not with the exception above. This is easy to solve imho. Thanks a lot.

cupakob
  • 1,057
  • 3
  • 13
  • 17