如何修复 Bundler 下的 Ruby Date 版本错误?

问题描述 投票:0回答:0

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
之间存在dateversion问题。我的
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。老版本安装了,但是不知为何不能用

我该如何解决这个问题?

ruby date bundler
© www.soinside.com 2019 - 2024. All rights reserved.