ruby-on-rails - 从 rails 5.1 升级到 5.2 时,如何更新 Gemfile?
问题描述
我正在尝试将我的 rails 应用程序从 5.1.4 升级到 5.2。
我已经完成了这里的步骤: https ://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-5-1-to-5-2.html
但是,这完全跳过了如何更新 gemfile。
当我改变
gem 'rails', '~> 5.1.4'
到
gem 'rails', '~> 5.2.2'
我收到错误:
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (= 5.1.6.1)
In Gemfile:
rails (~> 5.2.2) was resolved to 5.2.2, which depends on
activesupport (= 5.2.2)
sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
railties (>= 4.0.0, < 6) was resolved to 5.1.6.1, which depends on
activesupport (= 5.1.6.1)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
我可以解决这些错误,但这似乎是一种不完整的更新方式。
更新 gemfile 的正确方法是什么?
解决方案
bundle update rails
在此之后,您可以使用 gem "bundleup" 查看可以更新的其他 gem。
推荐阅读
- c# - 用于创建通讯组列表的 Outlook 加载项(实时和桌面)
- javascript - 从动态生成的下拉菜单中删除一个选项
- python - Pandas 从列中获取唯一值,并且仅有效地获取最新日期
- obfuscar - asp.net core 3.1 的混淆器
- python-3.x - 调用位于另一个类的方法中的变量(Tkinter)
- java - 一遍又一遍地调用read方法时,FileInputStream类是如何知道偏移量的呢?
- php - 从cron执行的php脚本表现得很奇怪
- datetime - 是否有从不同日期选择一组小时的功能?
- sql - 仅存储 1 个值并删除其余的 bigquery 中相同的重复值
- widget - 如何保持显示最新以监控 tk 小部件的选项值