【发布时间】:2021-03-29 17:38:18
【问题描述】:
在 MimeMagic 依赖失败后,我现在无法在 Rails 中生成模型。尝试在 rails 中生成用户模型后,我收到以下警告消息和堆栈跟踪错误
rails generate model User email:string
password_digest:string
Warning: the running version of Bundler (2.2.3) is
older than the version that created the lockfile
(2.2.15). We suggest you to upgrade to the version
that created the lockfile by running `gem install
bundler:2.2.15`.
但是,我的 Gemfile 已更新到 2.2.15,我再次运行 bundle install 无济于事。
这是该警告之后的堆栈跟踪错误的一部分:
/Users/shmeadyy/Desktop/Projects/scheduled_tweets/vendor/bundle/ruby/3.0.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `require': incompatible library version - /Users/shmeadyy/Desktop/Projects/scheduled_tweets/vendor/bundle/ruby/3.0.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle (LoadError)
from /Users/shmeadyy/Desktop/Projects/scheduled_tweets/vendor/bundle/ruby/3.0.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `<top (required)>'
from /Users/shmeadyy/Desktop/Projects/scheduled_tweets/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/store.rb:4:in `require'
from /Users/shmeadyy/Desktop/Projects/scheduled_tweets/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/store.rb:4:in `block in <top (required)>'
【问题讨论】:
-
您是否尝试删除
gemfile.lock并使用bundle install重新生成它? -
是的,试了几次都没有成功。我不明白发生了什么,因为当我检查版本号时,我的机器上有最新版本的捆绑程序,当我执行新的
bundle install时,它说它已与最新版本捆绑在一起。
标签: ruby-on-rails ruby rubygems