2017-02-12 143 views
1

我最近將我的Heroku應用從Ruby 2.3.1更新爲2.4.0,但我現在需要恢復到版本2.3.1Heroku降級/恢復Ruby版本

要更新:

我改變了Gemfile版本從2.3.12.4.0。一切都很好,但我需要回去2.3.1因爲問題的具體到我2.4.0

要恢復:

我試着改變版本回到2.3.1Gemfile(如ruby "2.3.1"),但它只是拋出打包機錯誤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 
+0

它什麼時候拋出這個錯誤嗎? –

+0

我添加了更新錯誤 – teddybear

+1

您是否在修改Gemfile後運行'bundle install'? –

回答

1

我想通了。下面是步驟

本地:

更改了Ruby版本從2.4.02.3.1

驗證版本是2.3.1ruby -v

運行gem install bundler & & gem install rails

運行bundle install

提交GemfileGemfile.lock推到Heroku的