Keep track of any errors that occur as you progress through the rails tutorial. The hardware uses MacBook Air, and the development environment uses VScode.
"OK, deploy! It's similar to pushing to GitHub!" "You can do this !!!!!!"
$ heroku login
$ git init
$ heroku git:remote -a app name
$ git add .
$ git commit -am "first commit"
$ git push heroku master
: small_red_triangle_down: Result
$ git push heroku master
~abridgement~
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
~abridgement~
remote: Could not create Makefile due to some reason, probably lack of necessary
~abridgement~
remote: An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
~abridgement~
remote: !
remote: ! Failed to install gems via Bundler.
remote: ! Detected sqlite3 gem which is not supported on Heroku:
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to tutorial-app-20200717.
remote:
To https://git.heroku.com/app name.git
![remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/app name.git'
And you will have a headache.
After pushing to git, I'll deploy to heroku! It is an error that people who rushed forward as it is are addicted to.
This error occurs because ** Heroku doesn't support SQLite. So change the database to PostgreSQL. ** **
"OK! I'll do it because I know the solution!", 1.5.1 Heroku setup and Beginner .. Heroku keeps failing to build. .. , but it doesn't work ...
** If you haven't tried the methods on the above site, you'll have to start over, but as a last resort, try the following: ** **
Please note that it will be a solution to start over again ... "Everyone can do it!"
Let's do it right away.
Change before
$ rails _5.1.6_new app name
After change
$ rails _5.1.6_new app name--database=postgresql
Doing this will generate a rails framework with PostgreSQL specified from the beginning.
After that, you can proceed with the same procedure as before. Once you're done, try pushing to heroku.
If you find it useful, I would be grateful if you could click the ** LGTM button. ** ** Let's do our best to learn Rails together! : raised_hand_tone1:
By the way, if you do this operation in rails6 without specifying the version of rails, you will get the following error.
$ rails s
Try to access [localhost: 3000](http: // localhost: 3000 /).
> On the red error screen, you should see an error statement similar to the following:
FATAL: database "app name" does not exist
ActiveRecord::NoDatabaseError
> The solution in this case is summarized here.
[Resolve ActiveRecord :: NoDatabaseError on rails6](https://qiita.com/satomomo0222/items/0d7f91b9c5403e9d2b68)
Recommended Posts