21
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Bundler 2 系を使ったアプリを Heroku にデプロイする (You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError))

21
Last updated at Posted at 2019-01-03

更新

現在は公式で Bundler 2 に対応しているので、本記事の内容は古くなっています。
デフォルトの Buildpack に戻すには下記が参考になります。

[heroku] bundler 2.0+ をつかえるようにbuildpackをカスタムしていてpushが弾かれた話 - Qiita
https://qiita.com/hirocueki2/items/4da0ff2f6e8d2f8002c3

古い内容

Heroku の公式の Ruby buildpack では Bundler のバージョンが 1.15 なので、Bundler 2 で作成した Gemfile は現時点ではビルドに失敗してしまう。

Heroku が公式に対応するまでの間に Heroku で Bundler 2 を使いたい場合は、Bundler チームが作成した bundler/heroku-buildpack-bundler2 を利用することができる 1

ただし、これは Heroku が公式にサポートする buildpack ではなく、Bundler チームからのサポートも限られているため、production で使用するには事前にテストすることが強く推奨されている 2

# Buildpack を入れ替える
heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2.git

# 次回デプロイ以降 Bundler 2 が利用される
git push heroku master
  1. https://bundler.io/v2.0/guides/bundler_2_upgrade.html#will-heroku-have-bundler-2

  2. https://github.com/bundler/heroku-buildpack-bundler2/blob/master/README.md#important

21
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?