Launchy :: ApplicationNotFoundError:

Trying to get save_and_open_page to work at all gives me the following error:

 1) index page my first test Failure/Error: save_and_open_page Launchy::ApplicationNotFoundError: No application found to handle 'C:/Sites/Sublist_v2/tmp/capybara/capybara-201304211638563116158687.html' # ./spec/features/comics_page_spec.rb:6:in `block (2 levels) in <top (required)>' 

Spec:

 require 'spec_helper' feature 'index page' do scenario "my first test" do visit root_path save_and_open_page # Launchy.open('http://stackoverflow.com') end end 

If I uncomment the Launchy line, it works fine, so I'm not sure what the problem is ... maybe the problem is with the path c:/ ?

Gemfile

 group :development, :test do gem 'spork-rails' gem 'rspec-rails' gem 'factory_girl_rails' end group :test do gem 'faker' gem 'capybara' gem 'launchy' gem 'database_cleaner' gem 'shoulda-matchers' end 
+8
ruby-on-rails integration-testing rspec capybara
source share
3 answers

This is because the drive letter in the file path is not correctly defined as part of the uri scheme.

You can fix this temporarily by changing line 12 in /launchy/lib/launchy/applications/browser.rb:

return true if File.exist?( uri.path ) and uri.scheme.nil?

to

return true if File.exist?( uri.path ) && !schemes.include?( uri.scheme )

+7
source share

I am the author of Launchy and was just informed about this issue. I generally make bug fixes through GitHub and put this issue there. Problem number 65

At any time when you encounter a problem with Launchy, enable debugging and indicate the problem with the project in github

You can enable debugging by setting the environment variable LAUNCHY_DEBUG=true . You can do this either from the shell or using the ruby ​​code if you paste the launch into the application.

 % export LAUNCHY_DEBUG=true % launchy http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror AUNCHY_DEBUG: URI parsing pass 1 : http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror -> {:scheme=>"http", :user=>nil, :password=>nil, :host=>"stackoverflow.com", :port=>nil, :path=>"/questions/16137410/launchyapplicationnotfounderror", :query=>nil, :fragment=>nil} LAUNCHY_DEBUG: Checking if class Launchy::Application::Browser is the one for handles?(http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Windows is the one for matches?(darwin12.2.0)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(darwin12.2.0)} 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?(darwin12.2.0)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(darwin12.2.0)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::RubyEngine::Mri is the one for is_current_engine?(ruby)} LAUNCHY_DEBUG: Launchy::Application : found executable /usr/bin/open LAUNCHY_DEBUG: Launchy::Application::Browser : possibility : /usr/bin/open LAUNCHY_DEBUG: Launchy::Application::Browser : Using browser value '/usr/bin/open' LAUNCHY_DEBUG: wet_run: before exec in child process LAUNCHY_DEBUG: commandline_normalized => /usr/bin/open http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror 

Or if you insert starty:

 % irb >> require 'launchy' >> ENV['LAUNCHY_DEBUG']="true" >> Launchy.open( "http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror" ) LAUNCHY_DEBUG: URI parsing pass 1 : http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror -> {:scheme=>"http", :user=>nil, :password=>nil, :host=>"stackoverflow.com", :port=>nil, :path=>"/questions/16137410/launchyapplicationnotfounderror", :query=>nil, :fragment=>nil} LAUNCHY_DEBUG: Checking if class Launchy::Application::Browser is the one for handles?(http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Windows is the one for matches?(darwin12.2.0)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(darwin12.2.0)} 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?(darwin12.2.0)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(darwin12.2.0)} LAUNCHY_DEBUG: Checking if class Launchy::Detect::RubyEngine::Mri is the one for is_current_engine?(ruby)} LAUNCHY_DEBUG: Launchy::Application : found executable /usr/bin/open LAUNCHY_DEBUG: Launchy::Application::Browser : possibility : /usr/bin/open LAUNCHY_DEBUG: Launchy::Application::Browser : Using browser value '/usr/bin/open' LAUNCHY_DEBUG: wet_run: before exec in child process >> LAUNCHY_DEBUG: commandline_normalized => /usr/bin/open http://stackoverflow.com/questions/16137410/launchyapplicationnotfounderror 
+5
source share

I just needed to do:

 fileUri = 'file:///' + outputFile.path Launchy.open(fileUri) 

notice the three slashes after "file:". This is with github-markdown-0.5.5 on Windows 8.

+1
source share

All Articles