###前提・実現したいこと
herokuにrailsのアプリケーションをデプロイしたいです。
heroicを使用するのは、初めてなので、とりあえずscaffoldしたアプリ(rails g scaffold Post title)を載せてみることにしました。(Rails 5.0.1 , ruby 2.3.1p112)
参考にした記事は、こちらです。
他の記事とかも参考にして、何度もチャレンジしたんですけど、できません
でした。解決策が分かる方よろしくお願いします。
###発生している問題・エラーメッセージ
heroku run rake db:migrateすると
vagrant@vagrant-ubuntu-trusty-32:/vagrant/heroku/heroku_sample$ heroku run rake db:migrate Running rake db:migrate on ⬢ fatwlink2... up, run.8540 (Free) /usr/bin/env: ruby2.3: No such file or directory vagrant@vagrant-ubuntu-trusty-32:/vagrant/heroku/heroku_sample$ heroku open vagrant@vagrant-ubuntu-trusty-32:/vagrant/heroku/heroku_sample$
No such file or directoryとなってしまい、heroku openとコマンドを打っても、ブラウザで開かれません。
そこで、herokuのホームページからopen appボタンで、ページを開いたんですが、
Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
このように表示されてしまい。アプリが出ませんでした。
###該当のソースコード
scaffoldしたアプリからherokuにあげるために、変更した点は以下です。
Gemfile gem 'sqlite3' から gem 'sqlite3', group: :development gem 'pg', group: :production に変更
database.yml production: <<: *default database: db/production.sqlite3 から production: <<: *default adapter: postgresql encoding: unicode pool: 5 に変更
###試したこと
gemにrails_12factorを入れたりもしましたが、ダメでした。
group :development do gem 'sqlite3' end group :production do gem 'pg' gem 'rails_12factor' end
###補足情報(他にエラーが出ていると思われるところ)
git push heroku master した時に、途中に以下のような部分が出てくる。
remote: ###### WARNING: remote: You have not declared a Ruby version in your Gemfile. remote: To set your Ruby version add this line to your Gemfile: remote: ruby '2.2.6' remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information. remote: remote: ###### WARNING: remote: No Procfile detected, using the default web server. remote: We recommend explicitly declaring how to boot your server process via a Procfile. remote: https://devcenter.heroku.com/articles/ruby-default-web-server
heroicのログに、以下のような部分が出てくる。
2017-02-09T20:08:44.811284+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fatwlink2.herokuapp.com request_id=dfff0c42-2cf8-4265-b369-50cb5d1dde6c fwd="36.12.97.76" dyno= connect= service= status=503 bytes= 2017-02-09T20:09:08.764333+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fatwlink2.herokuapp.com request_id=ff0df38c-7a2d-4217-965c-870c4662f343 fwd="36.12.97.76" dyno= connect= service= status=503 bytes=
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。