Search code examples
herokulearn-ruby-on-rails

'Learn Ruby on Rails' tutorial: Can't submit contact form


I am getting the error below following the tutorial in the book Learn Ruby on Rails.

I am able to launch my app manually by typing the URL into my browser but am wondering why Heroku open does not work.

Any idea what is happening here?

Heroku open error...

$ heroku open                                                                                                             
Opening peaks-app... failed                                                                                                                                                         
 !    Heroku client internal error.                                                                                                                                                 
 !    Search for help at: https://help.heroku.com                                                                                                                                   
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new                                                                                                               

    Error:       Unable to find a browser command. If this is unexpected, Please rerun with environment variable LAUNCHY_DEBUG=true or the '-d' commandline option and file a bug at
 https://github.com/copiousfreetime/launchy/issues/new (Launchy::CommandNotFoundError)                                                                                              
    Backtrace:   /home/action/.heroku/client/vendor/gems/launchy-2.4.2/lib/launchy/applications/browser.rb:63:in `browser_cmdline'                                                  
                 /home/action/.heroku/client/vendor/gems/launchy-2.4.2/lib/launchy/applications/browser.rb:67:in `cmd_and_args'                                                     
                 /home/action/.heroku/client/vendor/gems/launchy-2.4.2/lib/launchy/applications/browser.rb:78:in `open'                                                             
                 /home/action/.heroku/client/vendor/gems/launchy-2.4.2/lib/launchy.rb:29:in `open'                                                                                  
                 /home/action/.heroku/client/lib/heroku/helpers.rb:328:in `block in launchy'                                                                                        
                 /home/action/.heroku/client/lib/heroku/helpers.rb:227:in `action'                                                                                                  
                 /home/action/.heroku/client/lib/heroku/helpers.rb:326:in `launchy'                                                                                                 
                 /home/action/.heroku/client/lib/heroku/command/apps.rb:342:in `open'                                                                                               
                 /home/action/.heroku/client/lib/heroku/command.rb:217:in `run'                                                                                                     
                 /home/action/.heroku/client/lib/heroku/cli.rb:33:in `start'                                                                                                        
                 /home/action/.parts/bin/heroku:24:in `<main>'                                                                                                                      

    Command:     heroku open                                                                                                                                                        
    Version:     heroku-toolbelt/3.12.1 (x86_64-linux) ruby/2.1.1 

Solution

  • The short answer is that Heroku uses Launchy to launch my app and Launchy is looking for my browser. Since I am using Nitrous.io, I do not have a browser installed, so Launchy does not know what to do.

    The author of Launchy explains that "...launching a browser from within the virtual box would do nothing if there was no browser installed." https://github.com/copiousfreetime/launchy/issues/78

    Launching manually appears to be my only option at this point.