Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Update to launchy-2.0 #415

merged 1 commit into from

4 participants


I have updated launchy and the api that capybara was using is no longer in existence.

This pull requests should update capybara to the latest version of launchy and utilize the appropriate launchy api.



@joliss joliss closed this
@joliss joliss reopened this
@joliss joliss merged commit b0dbaf8 into jnicklas:master

Merged -- thank you!


Is this in a release yet? I'm pinning to git head to prevent this error.


Yes, it's in all recent Capybara releases.


Capybara should check that the version of Launchy is new enough; I was just running into a bug where save_and_open_page wasn't working because v0.4.0 doesn't support file URLs without "file:///". Not sure this should be a runtime check (i.e. Launchy::VERSION.split('.').first.to_i < 2) or if it would be acceptable to require Launchy ~> 2 as a non-development dependency.

@joliss joliss referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@joliss joliss referenced this pull request from a commit in joliss/capybara
@joliss joliss Check Launchy version as suggested by @levity in #415
Launchy versions older than 2.0.0 (like 0.4.0) are not compatible.
Capybara now complains if it finds such a Launchy version. (I tested all
of this.)

It's best not to require Launchy at runtime (to keep dependency proliferation in check), but I added a runtime check in #562.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 18, 2011
  1. @copiousfreetime

    Update to launchy-2.0

    copiousfreetime authored
This page is out of date. Refresh to see the latest.
2  capybara.gemspec
@@ -31,7 +31,7 @@ do |s|
s.add_development_dependency("sinatra", [">= 0.9.4"])
s.add_development_dependency("rspec", [">= 2.0.0"])
- s.add_development_dependency("launchy", [">= 0.3.5"])
+ s.add_development_dependency("launchy", ["~> 2.0.2"])
s.add_development_dependency("yard", [">= 0.5.8"])
s.add_development_dependency("fuubar", [">= 0.0.1"])
s.add_development_dependency("cucumber", [">= 0.10"])
2  lib/capybara/util/save_and_open_page.rb
@@ -23,7 +23,7 @@ def save_and_open_page(html, file_name=nil)
def open_in_browser(path) # :nodoc
require "launchy"
rescue LoadError
warn "Sorry, you need to install launchy (`gem install launchy`) and " <<
"make sure it's available to open pages with `save_and_open_page`."
2  spec/save_and_open_page_spec.rb
@@ -35,7 +35,7 @@
- Launchy::Browser.stub(:run)
+ Launchy.stub(:open)
def default_file_expectations
Something went wrong with that request. Please try again.