Ruby Webpage Doesn't Exist Error


#1

Hello, I’m redoing the [First Ruby on Rails Application (Web Development 101
PROJECT: YOUR FIRST RAILS APPLICATION), and when I’m trying to open my web page, I get the error as shown:

The build log is as follows (note that the warnings are in grey blocks, the rest is really just filler)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.6.1
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.1
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2
Using rack 2.0.6
Using rack-test 1.1.0
Using actionpack 5.2.2
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.2
Using globalid 0.4.2
Using activejob 5.2.2
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using mimemagic 0.3.3
Using marcel 0.3.3
Using activestorage 5.2.2
Using msgpack 1.2.7
Using bootsnap 1.4.1
Using bundler 1.17.2
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.2
Using coffee-rails 4.2.2
Using ffi 1.10.0
Using multi_json 1.13.1
Using jbuilder 2.8.0
Using pg 1.1.4
Using puma 3.12.0
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.2.2
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.0
Using sass-listen 4.0.0
Using sass 3.7.3
Using tilt 2.0.9
Using sass-rails 5.0.7
Using turbolinks-source 5.2.0
Using turbolinks 5.2.0
Using uglifier 4.1.20
Bundle complete! 19 Gemfile dependencies, 61 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle
Removing bundler (1.15.2)
Bundle completed (0.44s)
Cleaning up the bundler cache.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
-----> Installing node-v10.14.1-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Yarn executable was not detected in the system.
Download Yarn at https://yarnpkg.com/en/docs/install
Asset precompilation completed (1.54s)
Cleaning assets
Running: rake assets:clean
-----> Detecting rails configuration

WARNING:
   You set your `config.active_storage.service` to :local in production.
   If you are uploading files to this app, they will not persist after the app
   is restarted, on one-off dynos, or if the app has multiple dynos.
   Heroku applications have an ephemeral file system. To
   persist uploaded files, please use a service such as S3 and update your Rails
   configuration.
   
   For more information can be found in this article:
     https://devcenter.heroku.com/articles/active-storage-on-heroku
WARNING:
   We detected that some binary dependencies required to
   use all the preview features of Active Storage are not
   present on this system.
   
   For more information please see:
     https://devcenter.heroku.com/articles/active-storage-on-heroku
WARNING:
   No Procfile detected, using the default web server.
   We recommend explicitly declaring how to boot your server process via a Procfile.
   https://devcenter.heroku.com/articles/ruby-default-web-server

-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> console, rake, web
-----> Compressing…
Done: 42.7M
-----> Launching…
Released v7
https://pacific-garden-49466.herokuapp.com/ deployed to Heroku

I tried going over all the steps again, redeploying, but it didn’t seem to work. I’m using Mac Mojave 10.14.3 this time whereas last time I used linux on my windows computer. Any suggestions on how to fix this error?

Thanks in advance,
Wais


#2

It does exist here https://pacific-garden-49466.herokuapp.com/cars

Which leads me to believe you haven’t set a root route in the config/routes.rb file or if you did then you haven’t committed it to git.


#3

Hello,

I have both set the root route in the routes.rb file to root 'cars#index' and I committed the changes to git (and heroku). I have images of my screen with both below.

It’s odd because on the localhost:3000 link provided in the lesson, when I run my rails app as rails server I can access the webpage, so it couldn’t be a routing error. Do you possibly think it had something to do with how I set it up with heroku?

Thanks again,
Wais


#4

Do you have a routes.rb in the top level directory?

It should be in the config directory.

What it looks like is you created a new routes.rb file which isn’t being used. Look in the config directory and you will see a file of the same name which won’t have the root path set. That is the file being used.


#5

Hi,

Thanks that was the problem: what happened was that I ran the code routes.rb command in the terminal thinking that it would open the routes.rb file only, but since I was in the home directory and it couldn’t directly see one, I guess that’s when it made the new file.

Thanks again,
Wais