Heroku Installfest


#43

Hi @MacLure

You should be able to post in code just fine. Just place 3 backticks (the key on the left above the tab key) above and below your code on it’s own line and it will format as code.

If your terminal cannot locate a Gemfile I can only assume you are in the wrong directory. If you type ls when in the terminal it should output a list of files and folders in the directory you are in. See if there is a Gemfile there.


#44

Thank you @CouchofTomato! That was it.

However, now I’m on the first exercise in 1.5.3 (getting it to display “hola mundo!”) and my page is not updating. I’ve updated routes.rb to run ‘application#hello’, but the page still runs ‘application#goodbye’ after refreshing in the browser. What am I missing?


#45

At this step

heroku open

I received

 ▸    Error opening web browser.
 ▸    Error: Exited with code 3
 ▸
 ▸    Manually visit https://murmuring-escarpment-99943.herokuapp.com/ in your
 ▸    browser.

Searching “heroku exited with code 3” on Google doesn’t seem to give me a solution. Any idea what the issue is?


#46

@MacLure can you provide a link to the bit you are on?


#47

I would guess the terminal doesn’t have a variable set to your browser. I’m on my phone at the moment but if you Google for how to set the default browser in the terminal for whatever OS you use you should get some good results. If you still have an issue after that let me know.


#49

I’m using WSL. I found instructions to enter

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

when I do, it doesn’t list available browsers. It prints

update-alternatives: error: no alternatives for x-www-browsers

I alos tried adding

export BROWSER=/usr/bin/google-chrome

to bash and that didn’t work either. What can I try next?


#50

Sure, I’m at https://www.railstutorial.org/book/beginning#sec-heroku_step_two

I’m on Exercise 1, just below the image of a mostly blank browser window.


#51

You need to set the browser environment variable in your bashrc. To do that you need to locate the full path to the exe file that launches your browser in windows. Can you get that path? If not what browser do you use?


#52

Heroku uses git to track changes so you need to commit to git first.

git add .
git commit -m “update routes”
git push heroku master


#53

C:\Program Files (x86)\Google\Chrome\Application\chrome.exe


#54

You need to open your .bashrc file Ina text editor and add something like

export BROWSER="/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"

Then you’ll need to save it and open a new terminal to reload your bash profile then you can try and see if heroku open works.


#55

Isn’t .bashrc a linux file and therefore we shouldn’t open/edit it with a windows text editor?

So how is it possible to edit the file then?


#56

Figured it out. Works by using nano or vim text editor which do not use a GUI


#57

You can use nano or vim if you are comfortable navigating them. The alternative is to use the terminal to add to the bashrc file but I think you have to escape spaces in the directory name maybe.


#58

Thanks again @CouchofTomato!


#59
remote:        rake aborted!
remote:        SyntaxError: /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/config/routes.rb:6: syntax error, unexpected keyword_end, expecting end-of-input
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:277:in `block in load'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:277:in `load'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:57:in `block in load_paths'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:57:in `each'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:57:in `load_paths'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:20:in `reload!'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:43:in `block in updater'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/file_update_checker.rb:83:in `execute'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:44:in `updater'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:33:in `execute_if_updated'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/finisher.rb:130:in `block in <module:Finisher>'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/config/environment.rb:5:in `<main>'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
remote:        /tmp/build_5cbe731bf70f659cbea032e119f8c3bb/vendor/bundle/ruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
remote: 
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to sleepy-atoll-91698.
remote: 
To https://git.heroku.com/sleepy-atoll-91698.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sleepy-atoll-91698.git'

#60

Hi @DevanandGowda,

You have a syntax error in your config/routes.rb file.

If you can paste the contents of your routes.rb file here we can tell you what needs to be changed.


#61

I have attached screenshots of routes.rb and database.yml


#63

I have modified the contents of the database.yml which I found on one of the threads here


#64

In your routes file you have two end statements

Delete the last line and then try again.