sudo. Failing to follow this advice can cause a lot of headaches. In some instances, you might see a message in the terminal telling you to use
sudoand/or to install something with
apt. Ignore what the terminal says and follow the instructions below.
cdto move back inside your project directory so that the commands will work.
cdinto it now:
Ctrl + Cto close the server.
my_first_rails_appdirectory by using the
pwd(print working directory) command.
New repository. Give the repository a name (maybe
my_first_rails_app?), and make sure you do not initialise the repository with a README and Rails created one already. Click
SSHhas been selected and then copy the URL.
>symbols. Replace those symbols and everything between them with the URL that you copied from GitHub.
<SSH URL from above>with the URL that you copied.
herokuin the output.
Gemfileand edit it.
lsand verify that you see
Gemfilein the output. If you don't see it, navigate to the directory you created in Steps 2.2 and 2.3.
Gemfile. Open your app in VSCode by typing
code .(NOTE: The period at the end is important!)
Gemfileto open it in the editor. Then, delete the line that says,
Gemfile. To do this, we can simply run
--without productionhere because the pg gem relies on having the pg database installed locally. Without it the gem can't build the native extensions needed to interact with the database. That is something we would definitely recommend but not at this stage. An sqlite database is much easier to get up and running for development.
routes.rbfile to set our root route. We're going to do this so that we can see the application without having to append
/carsat the end of the URL.
configfolder in the file list at the left-hand side of the screen. One of the files inside the folder will be named
routes.rband make it match the example below:
git push heroku maincommand again.