首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法更新Gemfile

无法更新Gemfile
EN

Stack Overflow用户
提问于 2018-12-07 04:37:41
回答 1查看 306关注 0票数 0

我正在将我的Heroku托管的ROR应用程序从Ruby1.9.3升级到2.3.1p112

我在Heroku控制台上得到了这个错误

代码语言:javascript
复制
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,那么推送到Heroku会失败,它会给出上面的错误吗?

代码语言:javascript
复制
 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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-07 08:04:05

只管用

代码语言:javascript
复制
ruby '~> 2.5.1'

在你的Gemfile

代码语言:javascript
复制
2.5.1

在你的.ruby-version

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53663353

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档