日々・開発日誌

BLOG

Herokuメモの記事一覧


RoRをherokuにデプロイ時にsqllite3でエラー

2018-12-07

RoRで作ったアプリをherokuにデプロイ

$ git push heroku master

したら以下のようなエラーが

remote:        An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote:        continue
remote:        Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
remote:        
remote:        In Gemfile:
remote:          sqlite3
remote:
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 glacial-tor-45483.
remote:
To https://git.heroku.com/glacial-tor-45483.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/glacial-tor-45483.git'


gemfileの

gem 'sqlite3'

をコメントアウトして

gem 'sqlite3', groups: %w(test development), require: false
gem 'pg', groups: %w(production), require: false


を挿入。

その後

bundle install

としたら、postgresqlがインストールされていないと怒らえる。

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

postgresqlをインストール

$ brew install postgresql $ bundle install
$ git add .
$ git commit -m "コメント"
$ git push heroku master



成功!

お気軽にお問合せください

0532-74-8756
愛知県を中心に静岡県・岐阜県の東海三県を主に対応しております。
  • 名古屋市
  • 浜松市
  • 岐阜市
  • 豊橋市
  • 岡崎市
  • 一宮市
  • 瀬戸市
  • 半田市
  • 春日井市
  • 豊川市
  • 津島市
  • 碧南市
  • 刈谷市
  • 豊田市
  • 安城市
  • 西尾市
  • 蒲郡市
  • 犬山市
  • 常滑市
  • 江南市
  • 小牧市
  • 稲沢市
  • 新城市
  • 東海市
  • 大府市
  • 知多市
  • 知立市
  • 尾張旭市
  • 高浜市
  • 岩倉市
  • 豊明市
  • 日進市
  • 田原市
  • 愛西市
  • 清須市
  • 北名古屋市
  • 弥富市
  • みよし市
  • あま市
  • 長久手市