Ruby 3.1.2
MacOS Ventura
我有一夜之间在 cron 上实施的脚本。我收到以下错误:
require 'bundler/setup'
Bundler.require
这里是错误:
/Users/user3/.rbenv/versions/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/runtime.rb:304:in `check_for_activated_spec!': You have already activated date 3.3.3, but your Gemfile requires date 3.2.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
似乎在
3.2.2和
3.3.3之间存在
date
version
问题。我的 Gemfile
中没有任何内容,因为它是默认 gem。以下是版本:
date (3.3.3, 3.2.2)
Author: Tadayoshi Funaba
Homepage: https://github.com/ruby/date
Licenses: Ruby, BSD-2-Clause
Installed at (3.3.3): /Users/rich/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0
(3.2.2, default): /Users/rich/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0
在
Gemfile.lock
下specs:
有date (3.2.2)
但我的Ruby
版本有3.3.3。老版本安装了,但是不知为何不能用
我该如何解决这个问题?