您好,我正在使用外部 gem 构建一个 Discourse 插件。我已经采纳了其他帖子中关于使用外部 gem 的一些建议,例如 Requiring external gems 和 https://meta.discourse.org/t/plugin-using-own-gem/50007/3。这些建议涉及为使用的外部包添加额外的包。这对于开发 Discourse 插件来说效果很好。但是,有时在每次 Discourse 更新后,当使用该插件和最新版本的 Discourse 重新构建 Discourse 时,我会遇到与 gem 版本冲突相关的错误。
下面是一个错误示例
rake aborted!
Gem::LoadError: can't activate addressable-2.8.4, already activated addressable-2.8.5
我在其他插件中也观察到了类似的情况,如以下论坛帖子中的一些案例:Install discourse failed due to Custom Wizard plugin 和 https://meta.discourse.org/t/failed-to-bootstrap-after-upgrade/280283。
目前,我尝试的解决方案是更新包到最新版本,使其与 Discourse Core 中使用的版本保持一致。
但是,我想咨询一下,是否有不要求每次更新包都匹配 Discourse Core 中最新版本来更新包的解决方案。