2017-02-12 183 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的