launchy icon indicating copy to clipboard operation
launchy copied to clipboard

Launchy::CommandNotFoundError

Open HimaChitalia opened this issue 9 years ago • 3 comments

Hi, I am trying to use Launchy to open up browser from terminal in my CLI App.

I get below error

xprop: unable to open display ''
/usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy/applications/browser.rb:63:in browser_cmdline': Unable to find a browser command. If th is is unexpected, Please rerun with environment variable LAUNCHY_DEBUG=true or the '-d' commandline option and file a bug at https://github.com/copiou sfreetime/launchy/issues/new (Launchy::CommandNotFoundError) from /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy/applications/browser.rb:67:in cmd_and_args'
from /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy/applications/browser.rb:78:in open' from /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy.rb:29:in open'
from /home/himachhag-45739/code/popular-deals-from-slickdeals.net-cli/lib/popular_deals/cli.rb:49:in open_deal_in_browser' from /home/himachhag-45739/code/popular-deals-from-slickdeals.net-cli/lib/popular_deals/cli.rb:36:in menu'
from /home/himachhag-45739/code/popular-deals-from-slickdeals.net-cli/lib/popular_deals/cli.rb:8:in call' from ./bin/popular-deals:10:in

'

This is I got for launchy -d launchy -d
ERROR: Failure in opening uri nil with options {:debug=>true}: undefined method to_hash' for nil:NilClass Did you mean? to_h LAUNCHY_DEBUG: ERROR: Failure in opening uri nil with options {:debug=>true}: undefined method to_hash' for nil:NilClass
Did you mean? to_h
LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy.rb:34:in rescue in open' LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy.rb:40:in open'
LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy/cli.rb:68:in good_run' LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/lib/launchy/cli.rb:86:in run'
LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/gems/launchy-2.4.3/bin/launchy:4:in <top (required)>' LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/bin/launchy:22:in load'
LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/bin/launchy:22:in <main>' LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval'
LAUNCHY_DEBUG: /usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in <main>' Try launchy --help' for more information
.

I would also like to let you know that I am trying to open firefox or chrome with this. I am not sure if it is supported.

Any possible solution?

Thanks a lot in advance.

HimaChitalia avatar Apr 05 '17 19:04 HimaChitalia

Hi, I'm having the same error message. Any solution to this?

Evanto avatar May 27 '17 17:05 Evanto

Hi @HimaChitalia and @Evanto, my apologies, I didn't see this issue until @Evanto's message showed up.

Since its sounds like you are both using Launchy via the API i your own commandline api I would suggest doing (for @HimaChitalia):

LAUNCHY_DEBUG=true ./bin/popular-deals

That way I can see what launchy attempted to do. When you ran launchy -d that just ran the commandline without any uri so it failed because there was nothing on the commandline.

@Evanto if you could show how you are doing things that would be helpful. Either submit the snippet of code where you are using launchy or show how you are using it on the commandline and I can go further.

In most cases it is an environment issue where launchy is unable to find the browser command to launch.

copiousfreetime avatar May 28 '17 00:05 copiousfreetime

Closing as no upstream response.

copiousfreetime avatar Nov 16 '17 23:11 copiousfreetime