[英]Downgrade/Revert Ruby Version on Heroku
我最近將 Heroku 應用程序從 Ruby 2.3.1
更新到2.4.0
,但我現在需要恢復到版本2.3.1
。
更新:
我將Gemfile
的版本從2.3.1
更改為2.4.0
。 一切順利,但我需要回到2.3.1
因為2.4.0
特定問題
還原:
我已經嘗試在我的Gemfile
中將版本改回2.3.1
(如ruby "2.3.1"
),但它只是拋出了bundler 錯誤Your Ruby version is 2.4.0, but your Gemfile specified 2.3.1
如何在 Heroku 上將我的 Ruby 版本改回2.3.1
?
這是部署時的錯誤:
ID yupp
-----> heroku-buildpack-rgeo-prep app detected
-----> Removing cached .bundle/config
Writing new .bundle/config
-----> VendorBinaries app detected
-----> Found a .vendor_urls file
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.4.0
###### WARNING:
You have the `.bundle/config` file checked into your repository
It contains local state like the location of the installed bundle
as well as configured git local gems, and other settings that should
not be shared between multiple checkouts of a single repo. Please
remove the `.bundle/` folder from your repo and add it to your `.gitignore` file.
https://devcenter.heroku.com/articles/bundler-configuration
-----> Installing dependencies using bundler 1.13.7
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Your Ruby version is 2.4.0, but your Gemfile specified 2.3.1
Bundler Output: Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Your Ruby version is 2.4.0, but your Gemfile specified 2.3.1
!
! Failed to install gems via Bundler.
! Detected a mismatch between your Ruby version installed and
! Ruby version specified in Gemfile or Gemfile.lock:
! https://devcenter.heroku.com/articles/ruby-versions#your-ruby-version-is-x-but-your-gemfile-specified-y
!
! Push rejected, failed to compile Ruby app.
! Push failed
我想到了。 以下是步驟
本地:
將 Ruby 版本從2.4.0
更改為2.3.1
使用ruby -v
驗證版本為2.3.1
運行gem install bundler
&& gem install rails
運行bundle install
提交Gemfile
和Gemfile.lock
並推送到 Heroku
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.