MVP教室:Railsエラー内容

「MVP教室:Railsエラー内容」のアイキャッチ画像

MVP教室で発生したエラーをまとめてあります
詳細な情報やエラーの根本的な原因等をまとめていないので、正確さは保証できません
エラーが発生したら都度内容を更新+詳細をまとめていきます

 

$git push heroku masterのあとでsqlite3に関するエラーが発生する場合

  • ターミナルからコミットが正常にできていない場合があるので、bitbucketでpushが正常にできているか確認
  • できていなければMac使い(RubyMineなどのツールで)に代わりにコミットしてもらう
  • その後プロジェクトを削除してgit clone
  • Gemfile.lockを削除してbundle install
  • pg関連のエラーが出れば問題ない

参考記事:https://tex2e.github.io/blog/ruby/rails-on-heroku

 

 

$ git push heroku masterに関するエラー

# ターミナルで下記を実行
$ git push heroku master

# 下記エラーが発生
remote: !       No such app as warm-cove-92577.
fatal: repository 'https://git.heroku.com/warm-cove-92577.git/' not found

解決方法:

https://stackoverflow.com/questions/45885134/git-push-heroku-master-error-fatal-repository
https://qiita.com/konitter/items/71da5b9b40c1d20a6a11
https://qiita.com/ngtkk/items/05097d127db6a415a7d8

 

$ git push heroku master push後go view build logをクリック

zAn error occurred while installing sqlite3 (1.4.1), and Bundler cannot continue.
      Make sure that `gem install sqlite3 -v '1.4.1' --source 'https://rubygems.org/'`
      succeeds before bundling.

解決方法:

https://qiita.com/kouynhr02/items/f60b2f720b5cb731c6a8

 

Herokuにpushした後、エラー画面でActionView::Template::Errorがでる

ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "questions" does not exist
# ターミナルで下記実行
$ heroku rake db:migrate

参考リンク http://dogear11.hatenablog.com/entry/2015/08/11/000902

 

$ gem install pgでエラーがでる

Building native extensions. This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

    current directory: /home/vagrant/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pg-1.1.4/ext
/home/vagrant/.rbenv/versions/2.5.5/bin/ruby -r ./siteconf20190726-3470-tsy0xl.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/vagrant/.rbenv/versions/2.5.5/bin/$(RUBY_BASE_NAME)
        --with-pg
        --without-pg
        --enable-windows-cross
        --disable-windows-cross
        --with-pg-config
        --without-pg-config
        --with-pg_config
        --without-pg_config
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/vagrant/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/pg-1.1.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/vagrant/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pg-1.1.4 for inspection.
Results logged to /home/vagrant/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/pg-1.1.4/gem_make.out/

対処法

https://qiita.com/ueki05/items/66597d40ee3914559655