0

需要帮忙。使用 ruby​​(不是 rails)和 capybara-webkit gem 编写脚本。在 EC2 和 Linode 上都进行了检查,并且此错误仍然存​​在。

webkit_server: cannot connect to X server /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:103:in attempt_connect' /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:96:inconnect' /usr/lib/ruby/1.8/timeout.rb:62:in timeout' /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:94:inconnect' /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:17:in initialize' /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit.rb:26:innew' /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit.rb:26:in initialize' /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/webkit.rb:5:innew' /usr/lib/ruby/gems/1.8/gems/capybara-webkit-0.12.1/lib/capybara/webkit.rb:5 /usr/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/session.rb:61:in call' /usr/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/session.rb:61:indriver' /usr/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/session.rb:157:in visit' /usr/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/dsl.rb:161:invisit'

谢谢

4

1 回答 1

0

使用 xvfb 包生成虚拟帧缓冲区。问题已解决https://github.com/thoughtbot/capybara-webkit/issues/402

于 2012-10-19T06:10:48.410 回答