rails c 命令失败:您的包已锁定到 CFPropertyList (2.3.4) 如何解决?

rails c command fails: Your bundle is locked to CFPropertyList (2.3.4) How to resolve?

我正在开发我的应用程序,当我尝试 运行 rails c 时,它会导致此错误:

Your bundle is locked to CFPropertyList (2.3.4), but that version could not be 
found in any of the sources listed in your Gemfile. If you haven't changed sources, 
that means the author of CFPropertyList (2.3.4) 
has removed it. 
You'll need to update your bundle to a different version of CFPropertyList (2.3.4) 
that hasn't been removed in order to install.

运行 bundle install 安装缺少的 gem。

我不知道是什么原因突然导致了这个错误,但这似乎只在我 运行 rails c 时出现。所有其他 rails 命令都正常工作。我试过 运行ning bundle installbundle update 但错误仍然存​​在。有没有人遇到过这个错误?是否建议简单地删除“Gemfile.lock”中的违规行?

删除您的 Gemfile.lock 并重新运行 bundle install。它将使用适当的依赖项进行重建。如果问题仍然存在,则可能是两个或更多 gem 之间存在 version/dependency 冲突。