Capybara save_and_open_page ubuntu

时间:2014-03-24 22:43:36

标签: ruby-on-rails firefox ubuntu capybara

我正在运行Ubunut 13.04和Rubymine 6.0.3

我的问题是Launchy gem没有打开我的浏览器。

我对Capybara save_and_open_page进行了调查并执行了

Launchy.open(file_name,{debug:true})

保存html页面,但浏览器无法启动。

这是调试结果

LAUNCHY_DEBUG: URI parsing pass 1 : /home/dave/my_i/tmp/capybara/capybara-201401200000077817027890.html -> {:scheme=>nil, :user=>nil, :password=>nil, :host=>nil, :port=>nil, :path=>"/home/dave/my_i/tmp/capybara/capybara-201401200000077817027890.html", :query=>nil, :fragment=>nil}
LAUNCHY_DEBUG: URI parsing pass 2 : /home/dave/my_i/tmp/capybara/capybara-201401200000077817027890.html -> {:scheme=>nil, :user=>nil, :password=>nil, :host=>nil, :port=>nil, :path=>"/home/dave/my_i/tmp/capybara/capybara-201401200000077817027890.html", :query=>nil, :fragment=>nil}
LAUNCHY_DEBUG: Checking if class Launchy::Application::Browser is the one for handles?(/home/dave/my_i/tmp/capybara/capybara-201401200000077817027890.html)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Windows is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Nix is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::RubyEngine::Mri is the one for is_current_engine?(ruby)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Windows is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Nix is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::RubyEngine::Mri is the one for is_current_engine?(ruby)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::NixDesktopEnvironment::Kde is the one for is_current_desktop_environment?()}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::NixDesktopEnvironment::Gnome is the one for is_current_desktop_environment?()}
LAUNCHY_DEBUG: Launchy::Application : Unable to find `gnome-open' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : found executable /usr/bin/firefox
LAUNCHY_DEBUG: Launchy::Application : Unable to find `seamonkey' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `opera' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `mozilla' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `netscape' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `galeon' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application::Browser : possibility from app_list : firefox
LAUNCHY_DEBUG: Checking if class Launchy::Detect::NixDesktopEnvironment::Kde is the one for is_current_desktop_environment?()}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::NixDesktopEnvironment::Gnome is the one for is_current_desktop_environment?()}
LAUNCHY_DEBUG: Launchy::Application : Unable to find `gnome-open' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : found executable /usr/bin/firefox
LAUNCHY_DEBUG: Launchy::Application : Unable to find `seamonkey' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `opera' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `mozilla' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `netscape' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application : Unable to find `galeon' in /home/dave/.rvm/gems/ruby-2.0.0-p247@myi/bin, /home/dave/.rvm/rubies/ruby-2.0.0-p247/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247@global/bin, /home/dave/.rvm/bin, /usr/local/heroku/bin, /home/dave/.rvm/gems/ruby-2.0.0-p247/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /home/dave/JSMS
LAUNCHY_DEBUG: Launchy::Application::Browser : Using browser value 'firefox'
Fast Debugger (ruby-debug-ide 0.4.22, debase 0.0.9) listens on 127.0.0.1:49751
LAUNCHY_DEBUG: wet_run: before exec in child process
LAUNCHY_DEBUG: commandline_normalized => firefox /home/dave/my_i/tmp/capybara/capybara-201401200000077817027890.html

(process:18970): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

奇怪的是它看起来像是找到了firefox,但是我的默认浏览器是chrome

$ sudo update-alternatives --config x-www-browser

返回

There are 2 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).

  Selection    Path                           Priority   Status
------------------------------------------------------------
* 0            /usr/bin/google-chrome-stable   200       auto mode
  1            /usr/bin/firefox                40        manual mode
  2            /usr/bin/google-chrome-stable   200       manual mode

另一个奇怪的事情,它看起来像firefox正在运行(在系统监视器中我看到了进程) 但是我没有任何firefox窗口,当我尝试启动firefox时出现错误

Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system

这里有一些问题

a)我希望Launchy使用chrome而不是firefox

b)Firefox进程似乎没有正确启动(但是我可以正常启动firefox)

0 个答案:

没有答案