Не могу обновить Gemfile - PullRequest
       43

Не могу обновить Gemfile

0 голосов
/ 07 декабря 2018

Я обновляю свое ROR-приложение Heroku с Ruby 1.9.3 до 2.3.1p112

Я получаю эту ошибку на консоли Heroku

remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !     Detected a mismatch between your Ruby version installed and
remote:  !     Ruby version specified in Gemfile or Gemfile.lock. You can
remote:  !     correct this by running:
remote:  !     
remote:  !     $ bundle update --ruby
remote:  !     $ git add Gemfile.lock
remote:  !     $ git commit -m "update ruby version"
remote:  !     
remote:  !     If this does not solve the issue please see this documentation:
remote:  !     
remote:  !     https://devcenter.heroku.com/articles/ruby-versions#your-ruby-version-is-x-but-your-gemfile-specified-y

Так что я сделал это, а я нетуверен, как это исправить?Где находится 2.3.1?Если я установлю свой Gemfile на 2.3.1 вместо 2.3.1p112, тогда Pushing to Heroku завершится неудачно, и это выдаст мне вышеуказанную ошибку?

 MacBook-Pro-2:treesy-api me$ bundle platform --ruby
ruby 2.3.1p112
MacBook-Pro-2:treesy-api me$ bundler -v
Bundler version 1.17.1
MacBook-Pro-2:treesy-api me$ cat Gemfile.lock | grep -A 2 RUBY
RUBY VERSION
   ruby 2.3.1p112

MacBook-Pro-2:treesy-api me$ bundle update --ruby
Your Ruby version is 2.3.1, but your Gemfile specified 2.3.1p112
MacBook-Pro-2:treesy-api me$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin17]s

1 Ответ

0 голосов
/ 07 декабря 2018

Просто используйте

ruby '~> 2.5.1'

в вашем Gemfile и

2.5.1

в вашем .ruby-version

...